Message408411
According to the docs it should be
>>> xgrp = parser.add_argument_group()
rather than
>>> xgrp = grp.add_argument_group()
This seems to work:
>>> parser = argparse.ArgumentParser()
>>> grp = parser.add_argument_group('Database settings')
>>> grp.add_argument('--db-config')
_StoreAction(option_strings=['--db-config'], dest='db_config', nargs=None, const=None, default=None, type=None, choices=None, help=None, metavar=None)
>>> xgrp = parser.add_argument_group()
>>> xgrp.add_argument('--db-password')
_StoreAction(option_strings=['--db-password'], dest='db_password', nargs=None, const=None, default=None, type=None, choices=None, help=None, metavar=None)
>>> parser.parse_args(['-h'])
usage: [-h] [--db-config DB_CONFIG] [--db-password DB_PASSWORD]
options:
-h, --help show this help message and exit
Database settings:
--db-config DB_CONFIG
--db-password DB_PASSWORD |
|
Date |
User |
Action |
Args |
2021-12-12 23:07:35 | iritkatriel | set | recipients:
+ iritkatriel, Laszlo.Attila.Toth |
2021-12-12 23:07:35 | iritkatriel | set | messageid: <1639350455.75.0.0661671820779.issue46057@roundup.psfhosted.org> |
2021-12-12 23:07:35 | iritkatriel | link | issue46057 messages |
2021-12-12 23:07:35 | iritkatriel | create | |
|