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 Laszlo.Attila.Toth
Recipients Laszlo.Attila.Toth, iritkatriel
Date 2021-12-12.16:25:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1639326328.45.0.24411109797.issue46057@roundup.psfhosted.org>
In-reply-to
Content
Sorry, these are two bugs in fact. The current one, the help with minmal code:

import argparse

parser = argparse.ArgumentParser()
grp = parser.add_argument_group('Database settings')
grp.add_argument('--db-config')
xgrp = grp.add_argument_group()
xgrp.add_argument('--db-password')
parser.parse_args(['-h'])


The group's help output shows only --db-config option:

Database settings:
  --db-config DB_CONFIG

If I change the xgrp to be mutually exclusive group as:
xgrp = grp.add_mutually_exclusive_group()

then the output is the same as I expect for the previous code, too:

Database settings:
  --db-config DB_CONFIG
  --db-password DB_PASSWORD
History
Date User Action Args
2021-12-12 16:25:28Laszlo.Attila.Tothsetrecipients: + Laszlo.Attila.Toth, iritkatriel
2021-12-12 16:25:28Laszlo.Attila.Tothsetmessageid: <1639326328.45.0.24411109797.issue46057@roundup.psfhosted.org>
2021-12-12 16:25:28Laszlo.Attila.Tothlinkissue46057 messages
2021-12-12 16:25:28Laszlo.Attila.Tothcreate