[issue41854] argparse.add_mutually_exclusive_group fails for optional positional arguments

2020-10-17 Thread Reuben Thomas
Reuben Thomas added the comment: Thanks for the hint; could this be documented, please? -- ___ Python tracker ___ ___

[issue41854] argparse.add_mutually_exclusive_group fails for optional positional arguments

2020-10-16 Thread paul j3
paul j3 added the comment: Give the positional a non-none default: e.g. group.add_argument('args', metavar='ARGUMENT', nargs='*', default=[], help='arguments to PROGRAM') Since a '*' or '?' positional works with an empty list of arguments, it is "always seen". It

[issue41854] argparse.add_mutually_exclusive_group fails for optional positional arguments

2020-09-24 Thread Reuben Thomas
New submission from Reuben Thomas : The following code: group = parser.add_mutually_exclusive_group() group.add_argument('--install-only', action='store_true', help='just install the program, do not run it') group.add_argument('args', metavar='ARGUMENT', nargs='*',