Negating options
Jari Aalto
jari.aalto at cante.net
Tue Feb 7 16:30:08 GMT 2006
John A Meinel <john at arbash-meinel.com> writes:
> Erik Bågfors wrote:
>>> ... it's usefult to be able to negate boolean options.
>>> could make '--no' be a special option:
>>>
>>> $ bzr revert --no reprocess --merge-type weave
>
> I would like to see us be very regular about this, rather than being
> proper English.
> So while "dont-set-scripts-executable" is better English,
> "--no-set-scripts-executable" is more regular, and easier to figure out.
>
> So I would propose that we use either "--no-*" everywhere, or maybe a
> mix of "--no-*" and "--non-*". --no- is for actions/nouns, --non- is for
> adjectives. --non-empty, --no-default. but while --no-empty is a little
> unclear, it is more regular.
[1] Perl uses: --no<option>
http://perldoc.perl.org/Getopt/Long.html#Summary-of-Option-Specifications
The option does not take an argument and may be negated by prefixing
it with "no" or "no-". E.g. "foo!" will allow --foo (a value of 1
will be assigned) as well as --nofoo and --no-foo (a value of 0 will
be assigned). If the option has aliases, this applies to the aliases
as well.
[2] GNU uses: --options .. but doesn't define negations
http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
[3] Autoconf (./configure) uses: --{enable|disable}-option
SUMMARY
I vote against mixed choices (allowing both --no-* and --non-*); it's
not programmable friendly from 3rd party front ends (like Emacs).
The autoconf notation is too verbose.
Personally the minimized typing is good thing, so I would lean to
short (Perl) notation:
--no<option>
But as good is:
--no-<option>
Jari
More information about the bazaar
mailing list