Negating options

Denys Duchier duchier at ps.uni-sb.de
Sat Feb 4 14:23:57 GMT 2006


Aaron Bentley <aaron.bentley at utoronto.ca> writes:

> Now that command defaults are on the horizon, (or 'here' in my case)
> it's usefult to be able to negate boolean options.  I was thinking we
> could make '--no' be a special option that would negate the option
> following, like:
>
> $ bzr revert --no reprocess --merge-type weave

The GNU convention is that the negation of --foo is --no-foo

> Also, should we consider using optparse (perhaps as a backend) now that
> our needs are growing more sophisticated?

Yes.  I suggested it too a while ago and I remember pointing out that
OptionParser.allow_interspersed_args=false allows us to do option parsing in
several phases and thus stack command parsers, but I cannot find that email
anywhere in the archive.  I wanted this to stack parsers for global options and
command-specific options (thus allowing options to be freely mixed on the
command line) and I think it was you who pointed out that --no-plugins could not
be handled in that fashion and would need to be an exception.

Anyway, +1 from me on using optparse, if that counts.

Cheers,

--Denys






More information about the bazaar mailing list