[RFC] Some options should be 'common', not 'global'

Martin Pool mbp at sourcefrog.net
Mon Aug 27 12:51:16 BST 2007


On 8/24/07, Ian Clatworthy <ian.clatworthy at internode.on.net> wrote:
> In discussion on IRC today with Aaron re the nuances of implementing
> noise levels for commit, we came to the conclusion that there may be a
> good case for 3 types of options:
>
> * global - parsed specially with resulting limitations (e.g. can't be
>   used in aliases)
>
> * common - options always allowed for all commands, even if commands
>   decide to ignore them
>
> * command-specific - as now.
>
> In other words, we want to introduce "common" options over and above the
> existing stuff. Unlike global options, these would be supported in
> aliases and commands could provide custom help text for them.

I think we should have few of what are now global options like
--no-plugins.  They're almost like what zsh calls 'precommand
modifiers' in that we have to read them before anything else.  It
would be good if regular users never need to see them, as the majority
are debug options.

-Dfoo is, I think, currently global.  In general it doesn't need to
be, but it might be useful to be able to parse it out very early in
case someone is asking to debug plugin loading.

These options aren't listed in the help for any commands.

I would expect that -v and -q should be listed in the help for
commands where they do something, preferably with a description of
just what they do.

I don't have a strong opinion about accepting -v for commands where it
has no effect.

I think we should keep -n for --dry-run as that's quite conventional.
If you want the default then just --no-verbose.

> In terms of implementation, my expectation is that --quiet should be
> implemented at the bzrlib.trace level, while verbose would be a boolean
> flag passed to all commands.

That is how it works at present.  I think it would be better to have
them both passed as flags to the command rather than quiet acting on
trace.

In sum I would probably just add -q and -v to the commands where
they're needed, unless there's a strong desire to accept them even on
commands where they do nothing.

-- 
Martin



More information about the bazaar mailing list