Title: "python cmd --verbose" does not set verbosity
Type: behavior Stage:
Components: Distutils Versions: Python 3.5, Python 3.4, Python 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: BreamoreBoy, dstufft, merwok, tarek, zooko
Priority: normal Keywords: easy

Created on 2009-10-25 14:37 by zooko, last changed 2014-06-27 20:59 by BreamoreBoy.

Messages (3)
msg94453 - (view) Author: Zooko O'Whielacronx (zooko) Date: 2009-10-25 14:37
This command:

python --verbose darcsver

works as expected -- the presence of '--verbose' increases the verbosity
of logging.

This command:

python darcsver --verbose

does not increase the verbosity, nor does it tell me that the
"--verbose" option is an option unknown to the "darcsver" command.

This command:

python darcsver --quux

gives this helpful output:

usage: [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: --help [cmd1 cmd2 ...] or: --help-commands or: cmd --help

error: option --quux not recognized

I think that the middle command ("python darcsver --verbose")
ought to behave either like the first command by increasing the
verbosity, or like the last command by telling the user that "--verbose"
is not a known option in that position.

This is also
msg94518 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-10-26 22:00
There's this comment in

# All commands support the global options too, just by adding
# in 'global_options'.

So, that's a bug. I'll do this:

- if a command has a global option (except help) it will be reapplied to
the distribtuion object

- if a command has a global option (except help) but also defines it as
a local command option, it will not be reapplied to the distribtuion object

- if a command has a global option (except help) and it was already
provided at the regular place, it will be ignored and a warning will be
msg221731 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-27 20:59
Assuming that this is still an issue would someone like to propose a patch?
Date User Action Args
2014-06-27 20:59:58BreamoreBoysetversions: + Python 3.4, Python 3.5, - 3rd party, Python 3.1, Python 3.2
nosy: + BreamoreBoy, dstufft

messages: + msg221731

components: - Distutils2
2010-11-18 01:51:08merwoksetversions: + 3rd party, Python 3.1, Python 2.7, Python 3.2
nosy: zooko, tarek, merwok
title: "python MYCOMMAND --verbose" does not yield an unrecognized option error but also does not set the verbosity -> "python cmd --verbose" does not set verbosity
components: + Distutils2
type: behavior
keywords: + easy
resolution: accepted ->
2010-06-06 22:32:11merwoksetnosy: + merwok
2009-10-26 22:00:59tareksetpriority: normal
resolution: accepted
messages: + msg94518
2009-10-25 14:37:07zookocreate