Giovanni Cappellotto <potoma...@gmail.com> added the comment:

I took a stab at this, see attached PR.

I was able encode the first two cases described by @tarek, but not the first 
one because `_parse_command_opts` doesn't have visibility to the list of global 
options that have already been parsed.

Note:

I had to move `log.set_verbosity(self.verbose)` after the call to 
`_parse_command_opts` in order to correctly apply the verbosity level after all 
command options are parsed. I think there should be a better way to handle this 
case, maybe by creating a `verbose` setter that re-runs `log.set_verbosity` 
every time `verbose` value is updated.

----------
nosy: +potomak

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue7202>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to