monotone

monotone Mtn Source Tree

Root/options_list.hh

1#define OPT(name, string, type, default_, description)\
2 OPTVAR(name, type, name, default_)\
3 OPTION(name, name, has_arg<type >(), string, description)
4
5#define GOPT(name, string, type, default_, description)\
6 OPTVAR(globals, type, name, default_)\
7 OPTION(globals, name, has_arg<type >(), string, description)
8
9OPTSET(globals)
10
11OPTVAR(globals, args_vector, args, )
12OPTION(globals, positionals, true, "--", "")
13#ifdef option_bodies
14{
15 args.push_back(arg_type(arg));
16}
17#endif
18
19OPT(author, "author", utf8, , gettext_noop("override author for commit"))
20#ifdef option_bodies
21{
22 author = utf8(arg);
23}
24#endif
25
26OPT(automate_stdio_size, "automate-stdio-size", size_t, 32768,
27 gettext_noop("block size in bytes for \"automate stdio\" output"))
28#ifdef option_bodies
29{
30 automate_stdio_size = boost::lexical_cast<long>(arg);
31 if (automate_stdio_size <= 0)
32 throw bad_arg_internal(F("cannot be zero or negative").str());
33}
34#endif
35
36OPTSET(bind_opts)
37OPTVAR(bind_opts, std::list<utf8>, bind_uris, )
38OPTVAR(bind_opts, bool, bind_stdio, false)
39OPTVAR(bind_opts, bool, use_transport_auth, true)
40
41OPTION(bind_opts, bind, true, "bind",
42 gettext_noop("address:port to listen on (default :4691)"))
43#ifdef option_bodies
44{
45 bind_uris.push_back(utf8(arg));
46 bind_stdio = false;
47}
48#endif
49OPTION(bind_opts, no_transport_auth, false, "no-transport-auth",
50 gettext_noop("disable transport authentication"))
51#ifdef option_bodies
52{
53 use_transport_auth = false;
54}
55#endif
56OPTION(bind_opts, bind_stdio, false, "stdio",
57 gettext_noop("serve netsync on stdio"))
58#ifdef option_bodies
59{
60 bind_stdio = true;
61}
62#endif
63
64OPTVAR(branch, branch_name, branchname, )
65OPTION(branch, branch, true, "branch,b",
66 gettext_noop("select branch cert for operation"))
67#ifdef option_bodies
68{
69 branchname = branch_name(arg);
70}
71#endif
72
73OPT(brief, "brief", bool, false,
74 gettext_noop("print a brief version of the normal output"))
75#ifdef option_bodies
76{
77 brief = true;
78}
79#endif
80
81OPT(revs_only, "revs-only", bool, false,
82 gettext_noop("annotate using full revision ids only"))
83#ifdef option_bodies
84{
85 revs_only = true;
86}
87#endif
88
89GOPT(conf_dir, "confdir", system_path, get_default_confdir(),
90 gettext_noop("set location of configuration directory"))
91#ifdef option_bodies
92{
93 conf_dir = system_path(arg);
94 if (!key_dir_given)
95 key_dir = (conf_dir / "keys");
96}
97#endif
98
99OPT(date, "date", date_t, ,
100 gettext_noop("override date/time for commit"))
101#ifdef option_bodies
102{
103 try
104 {
105 date = date_t::from_string(arg);
106 }
107 catch (std::exception &e)
108 {
109 throw bad_arg_internal(e.what());
110 }
111}
112#endif
113
114GOPT(dbname, "db,d", system_path, , gettext_noop("set name of database"))
115#ifdef option_bodies
116{
117 dbname = system_path(arg);
118}
119#endif
120
121OPTION(globals, debug, false, "debug",
122 gettext_noop("print debug log to stderr while running"))
123#ifdef option_bodies
124{
125 global_sanity.set_debug();
126}
127#endif
128
129OPT(depth, "depth", long, -1,
130 gettext_noop("limit the number of levels of directories to descend"))
131#ifdef option_bodies
132{
133 depth = boost::lexical_cast<long>(arg);
134 if (depth < 0)
135 throw bad_arg_internal(F("cannot be negative").str());
136}
137#endif
138
139
140OPTSET(diff_options)
141
142OPTVAR(diff_options, std::string, external_diff_args, )
143OPTION(diff_options, external_diff_args, true, "diff-args",
144 gettext_noop("argument to pass external diff hook"))
145#ifdef option_bodies
146{
147 external_diff_args = arg;
148}
149#endif
150
151OPTVAR(diff_options, diff_type, diff_format, unified_diff)
152OPTION(diff_options, diff_context, false, "context",
153 gettext_noop("use context diff format"))
154#ifdef option_bodies
155{
156 diff_format = context_diff;
157}
158#endif
159OPTION(diff_options, diff_external, false, "external",
160 gettext_noop("use external diff hook for generating diffs"))
161#ifdef option_bodies
162{
163 diff_format = external_diff;
164}
165#endif
166OPTION(diff_options, diff_unified, false, "unified",
167 gettext_noop("use unified diff format"))
168#ifdef option_bodies
169{
170 diff_format = unified_diff;
171}
172#endif
173OPTVAR(diff_options, bool, no_show_encloser, false)
174OPTION(diff_options, no_show_encloser, false, "no-show-encloser",
175 gettext_noop("do not show the function containing each block of changes"))
176#ifdef option_bodies
177{
178 no_show_encloser = true;
179}
180#endif
181
182OPT(diffs, "diffs", bool, false, gettext_noop("print diffs along with logs"))
183#ifdef option_bodies
184{
185 diffs = true;
186}
187#endif
188
189OPTVAR(drop_attr, std::set<std::string>, attrs_to_drop, )
190OPTION(drop_attr, drop_attr, true, "drop-attr",
191 gettext_noop("when rosterifying, drop attrs entries with the given key"))
192#ifdef option_bodies
193{
194 attrs_to_drop.insert(arg);
195}
196#endif
197
198OPT(dryrun, "dry-run", bool, false,
199 gettext_noop("don't perform the operation, just show what would have happened"))
200#ifdef option_bodies
201{
202 dryrun = true;
203}
204#endif
205
206OPTION(globals, dump, true, "dump",
207 gettext_noop("file to dump debugging log to, on failure"))
208#ifdef option_bodies
209{
210 global_sanity.set_dump_path(system_path(arg).as_external());
211}
212#endif
213
214OPTVAR(exclude, args_vector, exclude_patterns, )
215OPTION(exclude, exclude, true, "exclude",
216 gettext_noop("leave out anything described by its argument"))
217#ifdef option_bodies
218{
219 exclude_patterns.push_back(arg_type(arg));
220}
221#endif
222
223OPT(bookkeep_only, "bookkeep-only", bool, false,
224 gettext_noop("only update monotone's internal bookkeeping, not the filesystem"))
225#ifdef option_bodies
226{
227 bookkeep_only = true;
228}
229#endif
230
231GOPT(ssh_sign, "ssh-sign", std::string, "yes",
232 gettext_noop("sign with ssh-agent, 'yes' to sign with ssh if key found, 'no' to force monotone to sign, 'check' to sign with both and compare"))
233#ifdef option_bodies
234{
235 ssh_sign = arg;
236}
237#endif
238
239OPT(full, "full", bool, false,
240 gettext_noop("print detailed version number"))
241#ifdef option_bodies
242{
243 full = true;
244}
245#endif
246
247GOPT(help, "help,h", bool, false, gettext_noop("display help message"))
248#ifdef option_bodies
249{
250 help = true;
251}
252#endif
253
254OPTVAR(include, args_vector, include_patterns, )
255OPTION(include, include, true, "include",
256 gettext_noop("include anything described by its argument"))
257#ifdef option_bodies
258{
259 include_patterns.push_back(arg_type(arg));
260}
261#endif
262
263GOPT(ignore_suspend_certs, "ignore-suspend-certs", bool, false,
264 gettext_noop("do not ignore revisions marked as suspended"))
265#ifdef option_bodies
266{
267 ignore_suspend_certs = true;
268}
269#endif
270
271
272OPTVAR(key, rsa_keypair_id, signing_key, )
273OPTION(globals, key, true, "key,k", gettext_noop("set key for signatures"))
274#ifdef option_bodies
275{
276 internalize_rsa_keypair_id(utf8(arg), signing_key);
277}
278#endif
279
280GOPT(key_dir, "keydir", system_path, ,
281 gettext_noop("set location of key store"))
282#ifdef option_bodies
283{
284 key_dir = system_path(arg);
285}
286#endif
287
288OPTVAR(key_to_push, std::vector<rsa_keypair_id>, keys_to_push, )
289OPTION(key_to_push, key_to_push, true, "key-to-push",
290 gettext_noop("push the specified key even if it hasn't signed anything"))
291#ifdef option_bodies
292{
293 rsa_keypair_id keyid;
294 internalize_rsa_keypair_id(utf8(arg), keyid);
295 keys_to_push.push_back(keyid);
296}
297#endif
298
299OPT(last, "last", long, -1,
300 gettext_noop("limit log output to the last number of entries"))
301#ifdef option_bodies
302{
303 last = boost::lexical_cast<long>(arg);
304 if (last <= 0)
305 throw bad_arg_internal(F("cannot be zero or negative").str());
306}
307#endif
308
309OPTION(globals, log, true, "log", gettext_noop("file to write the log to"))
310#ifdef option_bodies
311{
312 ui.redirect_log_to(system_path(arg));
313}
314#endif
315
316OPTSET(messages)
317OPTVAR(messages, std::vector<std::string>, message, )
318OPTVAR(messages, utf8, msgfile, )
319OPTION(messages, message, true, "message,m",
320 gettext_noop("set commit changelog message"))
321#ifdef option_bodies
322{
323 message.push_back(arg);
324}
325#endif
326OPTION(messages, msgfile, true, "message-file",
327 gettext_noop("set filename containing commit changelog message"))
328#ifdef option_bodies
329{
330 msgfile = utf8(arg);
331}
332#endif
333
334OPT(missing, "missing", bool, false,
335 gettext_noop("perform the operations for files missing from workspace"))
336#ifdef option_bodies
337{
338 missing = true;
339}
340#endif
341
342OPT(next, "next", long, -1,
343 gettext_noop("limit log output to the next number of entries"))
344#ifdef option_bodies
345{
346 next = boost::lexical_cast<long>(arg);
347 if (next <= 0)
348 throw bad_arg_internal(F("cannot be zero or negative").str());
349}
350#endif
351
352OPT(no_files, "no-files", bool, false,
353 gettext_noop("exclude files when printing logs"))
354#ifdef option_bodies
355{
356 no_files = true;
357}
358#endif
359
360OPT(no_graph, "no-graph", bool, false,
361 gettext_noop("do not use ASCII graph to display ancestry"))
362#ifdef option_bodies
363{
364 no_graph = true;
365}
366#endif
367
368OPT(no_ignore, "no-respect-ignore", bool, false,
369 gettext_noop("do not ignore any files"))
370#ifdef option_bodies
371{
372 no_ignore = true;
373}
374#endif
375
376OPT(no_merges, "no-merges", bool, false,
377 gettext_noop("exclude merges when printing logs"))
378#ifdef option_bodies
379{
380 no_merges = true;
381}
382#endif
383
384GOPT(norc, "norc", bool, false,
385gettext_noop("do not load ~/.monotone/monotonerc or _MTN/monotonerc lua files"))
386#ifdef option_bodies
387{
388 norc = true;
389}
390#endif
391
392GOPT(nostd, "nostd", bool, false,
393 gettext_noop("do not load standard lua hooks"))
394#ifdef option_bodies
395{
396 nostd = true;
397}
398#endif
399
400OPT(pidfile, "pid-file", system_path, ,
401 gettext_noop("record process id of server"))
402#ifdef option_bodies
403{
404 pidfile = system_path(arg);
405}
406#endif
407
408GOPT(quiet, "quiet", bool, false,
409 gettext_noop("suppress verbose, informational and progress messages"))
410#ifdef option_bodies
411{
412 quiet = true;
413 global_sanity.set_quiet();
414 ui.set_tick_write_nothing();
415}
416#endif
417
418GOPT(extra_rcfiles, "rcfile", args_vector, ,
419 gettext_noop("load extra rc file"))
420#ifdef option_bodies
421{
422 extra_rcfiles.push_back(arg_type(arg));
423}
424#endif
425
426GOPT(reallyquiet, "reallyquiet", bool, false,
427gettext_noop("suppress warning, verbose, informational and progress messages"))
428#ifdef option_bodies
429{
430 reallyquiet = true;
431 global_sanity.set_reallyquiet();
432 ui.set_tick_write_nothing();
433}
434#endif
435
436OPT(recursive, "recursive,R", bool, false,
437 gettext_noop("also operate on the contents of any listed directories"))
438#ifdef option_bodies
439{
440 recursive = true;
441}
442#endif
443
444OPTVAR(revision, args_vector, revision_selectors, )
445OPTION(revision, revision, true, "revision,r",
446 gettext_noop("select revision id for operation"))
447#ifdef option_bodies
448{
449 revision_selectors.push_back(arg_type(arg));
450}
451#endif
452
453GOPT(root, "root", std::string, ,
454 gettext_noop("limit search for workspace to specified root"))
455#ifdef option_bodies
456{
457 root = arg;
458}
459#endif
460
461OPT(set_default, "set-default", bool, false,
462 gettext_noop("use the current arguments as the future default"))
463#ifdef option_bodies
464{
465 set_default = true;
466}
467#endif
468
469GOPT(ticker, "ticker", std::string, ,
470 gettext_noop("set ticker style (count|dot|none)"))
471#ifdef option_bodies
472{
473 ticker = arg;
474 if (ticker == "none" || global_sanity.quiet_p())
475 ui.set_tick_write_nothing();
476 else if (ticker == "dot")
477 ui.set_tick_write_dot();
478 else if (ticker == "count")
479 ui.set_tick_write_count();
480 else
481 throw bad_arg_internal(F("argument must be 'none', 'dot', or 'count'").str());
482}
483#endif
484
485OPT(from, "from", args_vector, , gettext_noop("revision(s) to start logging at"))
486#ifdef option_bodies
487{
488 from.push_back(arg_type(arg));
489}
490#endif
491
492OPT(to, "to", args_vector, , gettext_noop("revision(s) to stop logging at"))
493#ifdef option_bodies
494{
495 to.push_back(arg_type(arg));
496}
497#endif
498
499OPT(unknown, "unknown", bool, false,
500 gettext_noop("perform the operations for unknown files from workspace"))
501#ifdef option_bodies
502{
503 unknown = true;
504}
505
506#endif
507
508OPT(verbose, "verbose", bool, false,
509 gettext_noop("verbose completion output"))
510#ifdef option_bodies
511{
512 verbose = true;
513}
514#endif
515
516GOPT(version, "version", bool, false,
517 gettext_noop("print version number, then exit"))
518#ifdef option_bodies
519{
520 version = true;
521}
522#endif
523
524OPTION(globals, xargs, true, "xargs,@",
525 gettext_noop("insert command line arguments taken from the given file"))
526#ifdef option_bodies
527{
528}
529#endif
530
531OPTSET(automate_inventory_opts)
532OPTVAR(automate_inventory_opts, bool, no_ignored, false)
533OPTVAR(automate_inventory_opts, bool, no_unknown, false)
534OPTVAR(automate_inventory_opts, bool, no_unchanged, false)
535OPTVAR(automate_inventory_opts, bool, no_corresponding_renames, false)
536
537OPTION(automate_inventory_opts, no_ignored, false, "no-ignored",
538 gettext_noop("don't output ignored files"))
539#ifdef option_bodies
540{
541 no_ignored = true;
542}
543#endif
544
545OPTION(automate_inventory_opts, no_unknown, false, "no-unknown",
546 gettext_noop("don't output unknown files"))
547#ifdef option_bodies
548{
549 no_unknown = true;
550}
551#endif
552
553OPTION(automate_inventory_opts, no_unchanged, false, "no-unchanged",
554 gettext_noop("don't output unchanged files"))
555#ifdef option_bodies
556{
557 no_unchanged = true;
558}
559#endif
560
561OPTION(automate_inventory_opts, no_corresponding_renames, false, "no-corresponding-renames",
562 gettext_noop("don't output corresponding renames if restricted on such nodes"))
563#ifdef option_bodies
564{
565 no_corresponding_renames = true;
566}
567#endif
568
569// Local Variables:
570// mode: C++
571// fill-column: 76
572// c-file-style: "gnu"
573// indent-tabs-mode: nil
574// End:
575// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
576

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status