monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] overwriteable and negatable options


From: Stephen Leake
Subject: [Monotone-devel] overwriteable and negatable options
Date: Sun, 13 Jun 2010 08:11:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (windows-nt)

Timothy, I noticed you edited the RoadMap wiki to say overwriteable and
negatable options is started on branch nvm.options. But I don't see that
branch yet.

I'd like to work on this as well. Can you push your branch, and outline
your plan?

I think there are two separate parts to this:

1) enhance the options parser (option.cc from_command_line) to support
   --[no]- for boolean options

    1a) rename all current boolean options that start with 'no' or
        equivalent

    1b) add a deprecation method for options that now have better names

2) ensure that all methods for getting options support overwriting
   previous settings.

I've started reading thru options.cc. I'm currently puzzled why there
are explicit option bodies in options_list.hh for bool options; it seems
the setter class should do that automatically. I think we'll need that
for --no-* to work.

I haven't looked at 2) yet.

I've looked thru the list of boolean options. Here are the ones that
currently start with "--no-", and just need to be renamed (no user-visible
changes):

OPTION(bind_opts, no_transport_auth, false, "no-transport-auth",
GOPT(no_default_confdir, "no-default-confdir", bool, false,
GOPT(format_dates, "no-format-dates", bool, true,
OPTION(diff_options, no_show_encloser, false, "no-show-encloser",
OPTION(messages, no_prefix, false, "no-prefix",
OPT(no_files, "no-files", bool, false,
OPT(no_graph, "no-graph", bool, false,
OPT(no_ignore, "no-respect-ignore", bool, false,
OPT(no_merges, "no-merges", bool, false,
GOPT(no_workspace, "no-workspace", bool, false,
OPTION(automate_inventory_opts, no_ignored, false, "no-ignored",
OPTION(automate_inventory_opts, no_unknown, false, "no-unknown",
OPTION(automate_inventory_opts, no_unchanged, false, "no-unchanged",
OPTION(automate_inventory_opts, no_corresponding_renames, false, 
"no-corresponding-renames",

These start with "--no", so the new name will be different. They are
probably only used in tests, so it should not be a problem:

GOPT(norc, "norc", bool, false,
GOPT(nostd, "nostd", bool, false,

This starts with "--non-", and will be a user-visible change:

GOPT(non_interactive, "non-interactive", bool, false,

This pair already has a negation version:

OPTVAR(diff_options, bool, without_header, false);
OPTVAR(diff_options, bool, with_header, false);

we could keep both, but deprecate 'without-header' and eventually remove
it. That requires adding an option deprecation method, that prints a
warning when users use a deprecated option.

If we have a deprecation method, we could keep "norc", "nostd", and
"non-interactive" as deprecated options as well.

This is somewhat problematic:

OPT(missing, "missing", bool, false,

It specifies a set of files to operate on; --no-missing would not make
much sense. On the other hand, it's not likely someone will specify
--missing as a default command option, so I think we can just ignore
this.


This group could perhaps be turned into a verbosity integer:

OPT(full, "full", bool, false,
GOPT(quiet, "quiet", bool, false,
GOPT(reallyquiet, "reallyquiet", bool, false,
OPT(verbose, "verbose", bool, false,

These options are not used much. I'll start a separate email thread on
this; it's really a separate issue.

-- 
-- Stephe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]