monotone

monotone Mtn Source Tree

Root/src/options_list.hh

1// Copyright (C) 2006 Timothy Brownawell <tbrownaw@gmail.com>
2// 2008-2010 Stephen Leake <stephen_leake@stephe-leake.org>
3//
4// This program is made available under the GNU GPL version 2.0 or
5// greater. See the accompanying file COPYING for details.
6//
7// This program is distributed WITHOUT ANY WARRANTY; without even the
8// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9// PURPOSE.
10
11/*
12 * This is a list of all options that monotone can take, what variables
13 * they get put into, and how they get there. There are 6 important macros
14 * available here (and only here):
15 *
16 * OPTSET(name)
17 * Defines a set of related options, which can easily be allowed for
18 * a particular command or reset together. It is named
19 * 'options::opts::name'.
20 *
21 * This is used primarily for convenience in specifying options for the
22 * CMD macro. Especially if several options always go together, they
23 * can be grouped into an optset and then only that optset has to be
24 * specified as an argument to the CMD macro when declaring commands
25 * that use all of those options.
26 *
27 * This is also used for resettable options; any option that has a
28 * reset flag needs to be directly in an optset that *only* contains
29 * (directly or through OPTSET_REL) the optvar's that should be
30 * re-initialized when the reset flag is given. Because the
31 * SIMPLE_OPTION family all declare an optset containing only the
32 * one option and its one optvar, you don't typically need to care
33 * about this.
34 *
35 * OPTSET_REL(parent, child)
36 * Declare a relationship between two optsets, so that if the parent
37 * is reset or allowed for a command the child will also be.
38 *
39 * For example "diff" takes all of the options that "automate diff"
40 * takes, plus some additional ones. So there is a line below,
41 * "OPTSET_REL(diff_options, au_diff_options)", and then "diff" takes
42 * options::opts::diff_options and "automate diff" takes
43 * options::opts::au_diff_options. Options that only apply to "diff"
44 * go in the diff_options optset, while options that apply to both
45 * go in the au_diff_options optset.
46 *
47 * OPTVAR(optset, type, name, default)
48 * Defines a variable 'type options::name' which is initialized to
49 * 'type (default)' and belongs to the named optset. When the optset
50 * is reset, this variable will be reset to 'type (default)'.
51 *
52 * OPTION(optset, name, hasarg, optstring, description)
53 * Declare an option named 'options::opts::name', which belongs to the
54 * given optset. 'optstring' can look like "foo", in which case it is
55 * specified as "--foo", or it can look like "foo,f", in which case it
56 * is specified as either "--foo" or "-f". The description is a
57 * translatable help text. 'hasarg' is a bool indicating whether this
58 * option takes an argument.
59 *
60 * Some expansions of this macro expect a function body, which looks
61 * like 'void (std::string const & arg)'. This is the 'setter' function
62 * for this option, and is called when the option is parsed. If the
63 * option was declared to not take an argument, 'arg' is empty.
64 * Otherwise, it is the given argument. In any case this function
65 * should set the option variables for this option and throw a
66 * 'bad_arg_internal' if this fails. The variables that are set must be
67 * part of the same optset as the option, or they won't get reset
68 * properly. When the function body is needed, 'option_bodies' will
69 * be defined.
70 *
71 *
72 * HIDE(option)
73 * Do not show the named option in normal help output. Hidden options
74 * are shown by the --hidden option.
75 *
76 * In general, options should be hidden if they are introduced for
77 * testing purposes.
78 *
79 * DEPRECATE(option, reason, deprecated_in, will_remove_in)
80 * Do not show the named option in help output (even with --hidden), and
81 * give a warning if it is used. The reason should be
82 * gettext_noop("some text here") as it is translatable.
83 *
84 *
85 * Option Strings
86 *
87 * Options can have a long name, a short name, and a 'reset' name. The
88 * long and short names run the function body in the '#ifdef
89 * option_bodies'. The 'reset' name is slightly different, it makes the
90 * optset that the option belongs to get reset. This means that if you
91 * have several related options in the same optset, you probably *don't*
92 * want to specify a reset name for any of them.
93 *
94 * If you want an option to belong to an optset and also be resettable,
95 * you can use OPTSET_REL to make the desired optset include the option's
96 * personal optset.
97 *
98 * The option string format is "long,s/reset". "--long" and "-s" are
99 * the long and short names, and set the option. "--reset" is the
100 * reset name, and resets the option. An option *must* have a long
101 * and/or short name, but isn't required to have a reset name. So
102 * "/foo" is invalid, but "foo,f", "foo/no-foo", "f/no-f", and
103 * "foo,f/no-foo" are all allowed.
104 */
105
106/*
107 * If you want different *default* values for an option based on what command
108 * is being run (for example --with-header/--no-with-header for 'diff' and
109 * 'automate diff'), use CMD_PRESET_OPTIONS(cmdname) { ... } defined in cmd.hh.
110 * It doesn't go in this file, but rather in the file where the command is
111 * defined (ideally immediately before the CMD() declaration for that same
112 * command, just to be consistent).
113 */
114
115#ifdef option_bodies
116template<typename T>
117void set_simple_option(T & t, std::string const & arg)
118{ t = T(arg, origin::user); }
119template<typename T>
120void set_simple_option(std::vector<T> & t, std::string const & arg)
121{ t.push_back(T(arg, origin::user)); }
122template<typename T>
123void set_simple_option(std::set<T> & t, std::string const & arg)
124{ t.insert(T(arg, origin::user)); }
125template<>
126void set_simple_option(bool & t, std::string const & arg)
127{ t = true; }
128void set_simple_option(u8 & t, std::string const & arg)
129{
130 long l = boost::lexical_cast<long>(arg);
131 if (l < 0 || l > 255)
132 throw bad_arg_internal(F("must be between 0 and 255").str());
133 else
134 t = (u8)l;
135}
136template<>
137void set_simple_option(std::string & t, std::string const & arg)
138{ t = arg; }
139void set_simple_option(date_t & t, std::string const & arg)
140{
141 try { t = date_t(arg); }
142 catch (std::exception & e)
143 { throw bad_arg_internal(e.what()); }
144}
145template<>
146void set_simple_option(std::vector<string> & t, std::string const & arg)
147{ t.push_back(arg); }
148template<>
149void set_simple_option(std::set<string> & t, std::string const & arg)
150{ t.insert(arg); }
151template<>
152void set_simple_option(enum_string & t, std::string const & arg)
153{ t.set(arg); }
154template<>
155void set_simple_option(enum_string_set & t, std::string const & arg)
156{ t.add(arg); }
157
158# define SIMPLE_OPTION_BODY(name) { set_simple_option(name, arg); }
159#else
160# define SIMPLE_OPTION_BODY(name)
161#endif
162/*
163 * This is a 'magic' option, and Does The Right Thing based on its data type:
164 * * If it's a bool, it will be true if the option is given and false if
165 * not given (or reset), and will not take an argument.
166 * * If it's a string or vocab type, it will be set to the argument if
167 * given, and set to the empty value (default constructor) if reset
168 * or not given.
169 * * If it's a container (vector/set) of strings or vocab types, each
170 * time the option is given the argument will be added to the collection
171 * (with push_back or insert), and the collection will be empty if the
172 * option is not given or is reset.
173 */
174#define SIMPLE_INITIALIZED_OPTION(name, optstring, type, init, description) \
175 OPTSET(name) \
176 OPTVAR(name, type, name, init) \
177 OPTION(name, name, has_arg<type >(), optstring, description) \
178 SIMPLE_OPTION_BODY(name)
179
180#define SIMPLE_OPTION(name, optstring, type, description) \
181 SIMPLE_INITIALIZED_OPTION(name, optstring, type, , description)
182
183#define GROUPED_SIMPLE_OPTION(group, name, optstring, type, description) \
184 OPTSET_REL(group, name) \
185 SIMPLE_OPTION(name, optstring, type, description)
186
187
188// because 'default_' is constructor arguments, and may need to be a list
189// This doesn't work if fed through SIMPLE_INITIALIZED_OPTION (it wouldn't
190// work with the other 2 SIMPLE_OPTION macros either, but it wouldn't make
191// sense in the first place with those).
192#define COMMA ,
193
194OPTSET(globals)
195
196// this is a magic option
197OPTVAR(globals, args_vector, args, )
198OPTION(globals, positionals, true, "--", "")
199#ifdef option_bodies
200{
201 args.push_back(arg_type(arg, origin::user));
202}
203#endif
204// this is a more magic option
205OPTION(globals, xargs, true, "xargs,@",
206 gettext_noop("insert command line arguments taken from the given file"))
207#ifdef option_bodies
208{
209}
210#endif
211
212
213SIMPLE_OPTION(author, "author", utf8, gettext_noop("override author for commit"))
214
215SIMPLE_OPTION(automate_stdio_size, "automate-stdio-size",
216 restricted_long<1>,
217 gettext_noop("block size in bytes for 'automate stdio' output"))
218
219SIMPLE_OPTION(auto_update, "update/no-update", bool,
220 gettext_noop("automatically update the workspace, if it was at a head and the "
221 "command creates a new head"))
222
223OPTSET(bind_opts)
224GROUPED_SIMPLE_OPTION(bind_opts, bind_uris, "bind", std::vector<utf8>,
225 gettext_noop("address:port to listen on (default :4691)"))
226HIDE(no_transport_auth)
227GROUPED_SIMPLE_OPTION(bind_opts, no_transport_auth, "no-transport-auth", bool,
228 gettext_noop("disable transport authentication"))
229HIDE(bind_stdio)
230GROUPED_SIMPLE_OPTION(bind_opts, bind_stdio, "stdio", bool,
231 gettext_noop("serve netsync on stdio"))
232
233HIDE(max_netsync_version)
234SIMPLE_OPTION(max_netsync_version, "max-netsync-version", u8,
235 gettext_noop("cause monotone to lie about the maximum netsync "
236 "protocol version that it supports, mostly for debugging"))
237HIDE(min_netsync_version)
238SIMPLE_OPTION(min_netsync_version, "min-netsync-version", u8,
239 gettext_noop("cause monotone to lie about the minimum netsync "
240 "protocol version it supports, useful for debugging or "
241 "if you want to prevent use of older protocol versions"))
242
243SIMPLE_OPTION(remote_stdio_host, "remote-stdio-host", arg_type,
244 gettext_noop("sets the host (and optionally the port) for a "
245 "remote netsync action"))
246
247SIMPLE_OPTION(branch, "branch,b", branch_name,
248 gettext_noop("select branch cert for operation"))
249
250SIMPLE_OPTION(brief, "brief/no-brief", bool,
251 gettext_noop("print a brief version of the normal output"))
252
253SIMPLE_OPTION(revs_only, "revs-only", bool,
254 gettext_noop("annotate using full revision ids only"))
255
256OPTVAR(globals, system_path, conf_dir, get_default_confdir() COMMA origin::user)
257OPTION(globals, conf_dir, true, "confdir",
258 gettext_noop("set location of configuration directory"))
259#ifdef option_bodies
260{
261 conf_dir = system_path(arg, origin::user);
262 if (!key_dir_given)
263 key_dir = (conf_dir / "keys");
264}
265#endif
266
267GROUPED_SIMPLE_OPTION(globals, no_default_confdir, "no-default-confdir/allow-default-confdir", bool,
268 gettext_noop("forbid use of the default confdir"))
269
270SIMPLE_OPTION(date, "date", date_t,
271 gettext_noop("override date/time for commit"))
272
273OPTSET(date_formats)
274OPTSET_REL(globals, date_formats)
275OPTVAR(date_formats, std::string, date_fmt, )
276OPTION(date_formats, date_fmt, true, "date-format",
277 gettext_noop("strftime(3) format specification for printing dates"))
278#ifdef option_bodies
279{
280 date_fmt = arg;
281 no_format_dates = false;
282}
283#endif
284GROUPED_SIMPLE_OPTION(date_formats, no_format_dates,
285 "no-format-dates", bool,
286 gettext_noop("print date certs exactly as stored in the database"))
287
288
289OPTVAR(globals, db_type, dbname_type, )
290OPTVAR(globals, std::string, dbname_alias, )
291OPTVAR(globals, system_path, dbname, )
292OPTION(globals, dbname, true, "db,d", gettext_noop("set name of database"))
293#ifdef option_bodies
294{
295 if (arg == memory_db_identifier)
296 {
297 dbname_type = memory_db;
298 }
299 else if (arg.size() > 0 && arg.substr(0, 1) == ":")
300 {
301 dbname_alias = arg;
302 dbname_type = managed_db;
303 }
304 else
305 {
306 dbname = system_path(arg, origin::user);
307 dbname_type = unmanaged_db;
308 }
309}
310#endif
311
312HIDE(roster_cache_performance_log)
313GROUPED_SIMPLE_OPTION(globals, roster_cache_performance_log, "roster-cache-performance-log",
314 system_path,
315 gettext_noop("log roster cache statistic to the given file"))
316
317SIMPLE_OPTION(depth, "depth", restricted_long<0>,
318 gettext_noop("limit the number of levels of directories to descend"))
319
320
321OPTSET(diff_options)
322OPTSET(au_diff_options)
323OPTSET_REL(diff_options, au_diff_options)
324
325GROUPED_SIMPLE_OPTION(diff_options, external_diff_args, "diff-args", std::string,
326 gettext_noop("argument to pass external diff hook"))
327GROUPED_SIMPLE_OPTION(au_diff_options, reverse, "reverse", bool,
328 gettext_noop("reverse order of diff"))
329GROUPED_SIMPLE_OPTION(diff_options, no_show_encloser, "no-show-encloser/show-encloser", bool,
330 gettext_noop("do not show the function containing each block of changes"))
331OPTSET_REL(au_diff_options, with_header)
332SIMPLE_OPTION(with_header, "with-header/without-header", bool,
333 gettext_noop("show the matching cset in the diff header"))
334
335OPTVAR(diff_options, diff_type, diff_format, unified_diff)
336OPTION(diff_options, diff_context, false, "context",
337 gettext_noop("use context diff format"))
338#ifdef option_bodies
339{
340 diff_format = context_diff;
341}
342#endif
343OPTION(diff_options, diff_external, false, "external",
344 gettext_noop("use external diff hook for generating diffs"))
345#ifdef option_bodies
346{
347 diff_format = external_diff;
348}
349#endif
350OPTION(diff_options, diff_unified, false, "unified",
351 gettext_noop("use unified diff format"))
352#ifdef option_bodies
353{
354 diff_format = unified_diff;
355}
356#endif
357
358
359SIMPLE_OPTION(diffs, "diffs/no-diffs", bool, gettext_noop("print diffs along with logs"))
360
361SIMPLE_OPTION(attrs_to_drop, "drop-attr", std::set<std::string>,
362 gettext_noop("when rosterifying, drop attrs entries with the given key"))
363
364SIMPLE_OPTION(dryrun, "dry-run/no-dry-run", bool,
365 gettext_noop("don't perform the operation, just show what would have happened"))
366
367SIMPLE_OPTION(drop_bad_certs, "drop-bad-certs", bool,
368 gettext_noop("drop certs signed by keys we don't know about"))
369
370GROUPED_SIMPLE_OPTION(globals, dump, "dump", system_path,
371 gettext_noop("file to dump debugging log to, on failure"))
372
373SIMPLE_OPTION(exclude, "exclude", args_vector,
374 gettext_noop("leave out anything described by its argument"))
375SIMPLE_OPTION(include, "include", args_vector,
376 gettext_noop("include anything described by its argument"))
377
378SIMPLE_OPTION(bookkeep_only, "bookkeep-only", bool,
379 gettext_noop("only update monotone's internal bookkeeping, not the filesystem"))
380
381SIMPLE_OPTION(move_conflicting_paths,
382 "move-conflicting-paths/no-move-conflicting-paths",
383 bool,
384 strdup((F("move conflicting, unversioned paths into '%s' "
385 "before proceeding with any workspace change") %
386 bookkeeping_resolutions_dir).str().c_str()))
387
388OPTSET_REL(globals, ssh_sign)
389SIMPLE_INITIALIZED_OPTION(ssh_sign, "ssh-sign", enum_string, "yes,no,only,check",
390 gettext_noop("controls use of ssh-agent. valid arguments are: "
391 "'yes' to use ssh-agent to make signatures if possible, "
392 "'no' to force use of monotone's internal code, "
393 "'only' to force use of ssh-agent, "
394 "'check' to sign with both and compare"))
395
396SIMPLE_OPTION(force_duplicate_key, "force-duplicate-key", bool,
397 gettext_noop("force genkey to not error out when the named key "
398 "already exists"))
399
400
401GROUPED_SIMPLE_OPTION(globals, help, "help,h", bool, gettext_noop("display help message"))
402
403SIMPLE_OPTION(show_hidden_commands, "hidden/no-hidden", bool,
404 gettext_noop("show hidden commands and options"))
405
406GROUPED_SIMPLE_OPTION(globals, ignore_suspend_certs, "ignore-suspend-certs/no-ignore-suspend-certs", bool,
407 gettext_noop("do not ignore revisions marked as suspended"))
408
409GROUPED_SIMPLE_OPTION(globals, non_interactive, "non-interactive/interactive", bool,
410 gettext_noop("do not prompt the user for input"))
411
412GROUPED_SIMPLE_OPTION(globals, key, "key,k/use-default-key", external_key_name,
413 gettext_noop("sets the key for signatures, using either the key "
414 "name or the key hash"))
415
416OPTSET_REL(globals, key_dir)
417SIMPLE_INITIALIZED_OPTION(key_dir, "keydir", system_path,
418 system_path(get_default_keydir(), origin::internal),
419 gettext_noop("set location of key store"))
420
421SIMPLE_OPTION(keys_to_push, "key-to-push", std::vector<external_key_name>,
422 gettext_noop("push the specified key even if it hasn't signed anything"))
423
424SIMPLE_OPTION(last, "last", restricted_long<1>,
425 gettext_noop("limit log output to the last number of entries"))
426
427GROUPED_SIMPLE_OPTION(globals, log, "log", system_path,
428 gettext_noop("file to write the log to"))
429
430OPTSET(messages)
431GROUPED_SIMPLE_OPTION(messages, message, "message,m", std::vector<std::string>,
432 gettext_noop("set commit changelog message"))
433GROUPED_SIMPLE_OPTION(messages, msgfile, "message-file", utf8,
434 gettext_noop("set filename containing commit changelog message"))
435HIDE(no_prefix)
436GROUPED_SIMPLE_OPTION(messages, no_prefix, "no-prefix", bool,
437 gettext_noop("no prefix to message"))
438
439SIMPLE_OPTION(missing, "missing", bool,
440 gettext_noop("perform the operations for files missing from workspace"))
441
442SIMPLE_OPTION(next, "next", restricted_long<1>,
443 gettext_noop("limit log output to the next number of entries"))
444
445SIMPLE_OPTION(no_files, "no-files/files", bool,
446 gettext_noop("exclude files when printing logs"))
447
448SIMPLE_OPTION(no_graph, "no-graph/graph", bool,
449 gettext_noop("do not use ASCII graph to display ancestry"))
450
451SIMPLE_OPTION(no_ignore, "no-respect-ignore/respect-ignore", bool,
452 gettext_noop("do not ignore any files"))
453
454SIMPLE_OPTION(no_merges, "no-merges/merges", bool,
455 gettext_noop("exclude merges when printing logs"))
456
457#ifdef WIN32
458# define NORC_TEXT gettext_noop("do not load '%APPDATA%\\monotone\\monotonerc' or " \
459 "'_MTN\\monotonerc' lua files")
460#else
461# define NORC_TEXT gettext_noop("do not load '~/.monotone/monotonerc' or " \
462 "'_MTN/monotonerc' lua files")
463#endif
464GROUPED_SIMPLE_OPTION(globals, norc, "no-standard-rcfiles/standard-rcfiles", bool, NORC_TEXT)
465#undef NORC_TEXT
466
467GROUPED_SIMPLE_OPTION(globals, nostd, "no-builtin-rcfile/builtin-rcfile", bool,
468 gettext_noop("do not load the built-in lua file with the default hooks"))
469
470DEPRECATE(old_norc, gettext_noop("please use '--no-standard-rcfiles' instead"), 1.0, 2.0)
471OPTION(globals, old_norc, false, "norc",
472 gettext_noop("old version of '--no-standard-rcfiles'"))
473#ifdef option_bodies
474{ norc = true; }
475#endif
476DEPRECATE(old_nostd, gettext_noop("please use '--no-builtin-rcfile' instead"), 1.0, 2.0)
477OPTION(globals, old_nostd, false, "nostd",
478 gettext_noop("old version of '--no-builtin-rcfile'"))
479#ifdef option_bodies
480{ nostd = true; }
481#endif
482
483GROUPED_SIMPLE_OPTION(globals, extra_rcfiles, "rcfile/clear-rcfiles", args_vector,
484 gettext_noop("load extra lua file"))
485
486SIMPLE_OPTION(pidfile, "pid-file/no-pid-file", system_path,
487 gettext_noop("record process id of server"))
488
489OPTSET(verbosity)
490OPTSET_REL(globals, verbosity)
491OPTVAR(verbosity, int, verbosity, 0)
492
493OPTION(verbosity, quiet, false, "quiet,q",
494 gettext_noop("decrease verbosity (undo previous '-v', then disable informational output, then disable warnings)"))
495#ifdef option_bodies
496{
497 --verbosity;
498 if (verbosity < -2)
499 verbosity = -2;
500}
501#endif
502OPTION(verbosity, verbose, false, "verbose,v",
503 gettext_noop("increase verbosity (undo previous '-q', and then enable debug output)"))
504#ifdef option_bodies
505{
506 ++verbosity;
507 if (verbosity > 1)
508 verbosity = 1;
509}
510#endif
511
512DEPRECATE(debug,
513 gettext_noop("please us '-v' (or '-v -v -v' if there are previous '-q' options)"),
514 1.0, 2.0)
515OPTION(globals, debug, false, "debug",
516 gettext_noop("print debug log to stderr while running"))
517#ifdef option_bodies
518{
519 verbosity = 1;
520}
521#endif
522
523DEPRECATE(reallyquiet, gettext_noop("please use '-q -q'"), 1.0, 2.0)
524OPTION(verbosity, reallyquiet, false, "reallyquiet",
525 gettext_noop("suppress warning, verbose, informational and progress messages"))
526#ifdef option_bodies
527{
528 verbosity = -2;
529}
530#endif
531
532SIMPLE_OPTION(full, "full/concise", bool,
533 gettext_noop("print detailed information"))
534
535SIMPLE_OPTION(formatted, "formatted/plain", bool,
536 gettext_noop("automatically run the output through nroff (default if the output is a terminal)"))
537
538
539GROUPED_SIMPLE_OPTION(globals, timestamps, "timestamps", bool,
540 gettext_noop("show timestamps in front of errors, warnings and progress messages"))
541
542SIMPLE_OPTION(recursive, "recursive,R/no-recursive", bool,
543 gettext_noop("also operate on the contents of any listed directories"))
544
545SIMPLE_OPTION(revision, "revision,r",args_vector,
546 gettext_noop("select revision id for operation"))
547
548GROUPED_SIMPLE_OPTION(globals, root, "root", std::string,
549 gettext_noop("limit search for workspace to specified root"))
550
551GROUPED_SIMPLE_OPTION(globals, no_workspace, "no-workspace/allow-workspace", bool,
552 gettext_noop("don't look for a workspace"))
553
554SIMPLE_OPTION(set_default, "set-default/no-set-default", bool,
555 gettext_noop("use the current netsync arguments and options "
556 "as the future default"))
557
558OPTSET_REL(globals, ticker)
559SIMPLE_INITIALIZED_OPTION(ticker, "ticker", enum_string, "count,dot,none",
560 gettext_noop("set ticker style (count|dot|none)"))
561
562SIMPLE_OPTION(from, "from/clear-from", args_vector,
563 gettext_noop("revision(s) to start logging at"))
564
565SIMPLE_OPTION(to, "to/clear-to", args_vector,
566 gettext_noop("revision(s) to stop logging at"))
567
568SIMPLE_OPTION(unknown, "unknown/no-unknown", bool,
569 gettext_noop("perform the operations for unknown files from workspace"))
570
571GROUPED_SIMPLE_OPTION(globals, version, "version", bool,
572 gettext_noop("print version number, then exit"))
573
574
575OPTSET(automate_inventory_opts)
576
577OPTSET_REL(automate_inventory_opts, no_ignored)
578SIMPLE_OPTION(no_ignored, "no-ignored/ignored", bool,
579 gettext_noop("don't output ignored files"))
580OPTSET_REL(automate_inventory_opts, no_unknown)
581SIMPLE_OPTION(no_unknown, "no-unknown/unknown",bool,
582 gettext_noop("don't output unknown files"))
583OPTSET_REL(automate_inventory_opts, no_unchanged)
584SIMPLE_OPTION(no_unchanged, "no-unchanged/unchanged", bool,
585 gettext_noop("don't output unchanged files"))
586OPTSET_REL(automate_inventory_opts, no_corresponding_renames)
587SIMPLE_OPTION(no_corresponding_renames, "no-corresponding-renames/corresponding-renames", bool,
588 gettext_noop("don't output corresponding renames if restricted on such nodes"))
589
590
591OPTSET(resolve_conflicts_opts)
592OPTVAR(resolve_conflicts_opts, bookkeeping_path,
593 resolve_conflicts_file, bookkeeping_conflicts_file)
594
595OPTION(resolve_conflicts_opts, resolve_conflicts_file, true, "resolve-conflicts-file",
596 gettext_noop("use file to resolve conflicts"))
597#ifdef option_bodies
598{
599 // we can't call bookkeeping_path::external_string_is_bookkeeping_path
600 // here, because we haven't found the workspace yet.
601 E(bookkeeping_path::internal_string_is_bookkeeping_path(utf8(arg, origin::user)),
602 origin::user,
603 F("conflicts file must be under '_MTN'"));
604 resolve_conflicts_file = bookkeeping_path(arg, origin::user);
605 resolve_conflicts = true;
606}
607#endif
608
609OPTSET_REL(resolve_conflicts_opts, resolve_conflicts)
610SIMPLE_OPTION(resolve_conflicts, "resolve-conflicts/no-resolve-conflicts", bool,
611 gettext_noop("specify conflict resolutions in a file, instead of interactively"))
612
613OPTSET(conflicts_opts)
614OPTVAR(conflicts_opts, bookkeeping_path, conflicts_file, bookkeeping_conflicts_file)
615
616OPTION(conflicts_opts, conflicts_file, true, "conflicts-file",
617 gettext_noop("file in which to store conflicts"))
618#ifdef option_bodies
619{
620 // we can't call bookkeeping_path::external_string_is_bookkeeping_path
621 // here, because we haven't found the workspace yet.
622 E(bookkeeping_path::internal_string_is_bookkeeping_path(utf8(arg, origin::user)),
623 origin::user,
624 F("conflicts file must be under '_MTN'"));
625 conflicts_file = bookkeeping_path(arg, origin::user);
626}
627#endif
628
629SIMPLE_OPTION(use_one_changelog, "use-one-changelog", bool,
630 gettext_noop("use only one changelog cert for the git commit message"))
631
632SIMPLE_OPTION(authors_file, "authors-file", system_path,
633 gettext_noop("file mapping author names from original to new values"))
634
635SIMPLE_OPTION(branches_file, "branches-file", system_path,
636 gettext_noop("file mapping branch names from original to new values "))
637
638SIMPLE_INITIALIZED_OPTION(refs, "refs", enum_string_set, "revs,roots,leaves",
639 gettext_noop("include git refs for 'revs', 'roots' or 'leaves'"))
640
641SIMPLE_OPTION(log_revids, "log-revids/no-log-revids", bool,
642 gettext_noop("include revision ids in commit logs"))
643
644SIMPLE_OPTION(log_certs, "log-certs/no-log-certs", bool,
645 gettext_noop("include standard cert values in commit logs"))
646
647SIMPLE_OPTION(import_marks, "import-marks", system_path,
648 gettext_noop("load the internal marks table before exporting revisions"))
649
650SIMPLE_OPTION(export_marks, "export-marks", system_path,
651 gettext_noop("save the internal marks table after exporting revisions"))
652
653// clean up after ourselves
654#undef SIMPLE_OPTION
655#undef SIMPLE_OPTION_BODY
656#undef GROUPED_SIMPLE_OPTION
657#undef SIMPLE_INITIALIZED_OPTION
658#undef COMMA
659
660// Local Variables:
661// mode: C++
662// fill-column: 76
663// c-file-style: "gnu"
664// indent-tabs-mode: nil
665// End:
666// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

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