This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author iritkatriel
Recipients Laszlo.Attila.Toth, iritkatriel
Date 2021-12-12.23:07:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1639350455.75.0.0661671820779.issue46057@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2021-12-12 23:07:35iritkatrielsetrecipients: + iritkatriel, Laszlo.Attila.Toth
2021-12-12 23:07:35iritkatrielsetmessageid: <1639350455.75.0.0661671820779.issue46057@roundup.psfhosted.org>
2021-12-12 23:07:35iritkatriellinkissue46057 messages
2021-12-12 23:07:35iritkatrielcreate