Closed GoogleCodeExporter closed 9 years ago
That's intentional because it's possible you might want those two --verbose
flags to
mean different things. If you want them to mean the same things, I'd suggest
using a
parent parser:
verbose_parser = argparse.ArgumentParser(add_help=False)
verbose_parser.add_argument('--verbose', action='store_true')
parser = argparse.ArgumentParser(parents=[verbose_parser])
subparsers = parser.add_subparsers()
foo_parser = subparsers.add_parser('foo', parents=[verbose_parser])
That should allow the same --verbose flag to be specified in either parser.
Original comment by steven.b...@gmail.com
on 7 Jan 2010 at 5:37
Original comment by steven.b...@gmail.com
on 28 Feb 2010 at 10:08
Original issue reported on code.google.com by
ianbick...@gmail.com
on 7 Jan 2010 at 12:07