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 Alexandre.Badez
Recipients Alexandre.Badez
Date 2015-07-27.12:52:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438001526.73.0.776043102355.issue24736@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,

Here is a sample of what I do:

>>> import argparse
>>> main_parser = argparse.ArgumentParser()
>>> group_ex = main_parser.add_mutually_exclusive_group()
>>> group_ex1 = group_ex.add_argument_group()
>>> group_ex1.add_argument('-a', '--atest', help="help about -a") and None
>>> group_ex1.add_argument('-b', '--btest', help="help about -b") and None
>>> group_ex.add_argument('-c', '--ctest', help="help about -c") and None
>>> main_parser.print_help()
usage: [-h] [-a ATEST] [-b BTEST] [-c CTEST]

optional arguments:
  -h, --help            show this help message and exit
  -c CTEST, --ctest CTEST
                        help about -c



Here is what I would except as help message:

>>> main_parser.print_help()
usage: [-h] [[-a ATEST] [-b BTEST]] | [-c CTEST]

optional arguments:
  -h, --help            show this help message and exit
  -c CTEST, --ctest CTEST
                        help about -c

  -a ATEST, --atest ATEST
                        help about -a
  -b BTEST, --btest BTEST
                        help about -b

						
Options '-a' and '-b' are not displayed in the help message due to the "add_mutually_exclusive_group".
History
Date User Action Args
2015-07-27 12:52:06Alexandre.Badezsetrecipients: + Alexandre.Badez
2015-07-27 12:52:06Alexandre.Badezsetmessageid: <1438001526.73.0.776043102355.issue24736@psf.upfronthosting.co.za>
2015-07-27 12:52:06Alexandre.Badezlinkissue24736 messages
2015-07-27 12:52:06Alexandre.Badezcreate