-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Support of mutually exclusive groups in the argparse help is very limited #142346
Copy link
Copy link
Closed
Labels
3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errortype-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errortype-featureA feature request or enhancementA feature request or enhancement
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Doc issues
Bug report
argparsesupports grouping mutually exclusive arguments in the usage. For example:Output:
But it does not work if there is a positional argument before a mutually exclusive group containing positional argument:
Output:
Expected output:
Or there is an optional argument after a mutually exclusive group:
Output:
Expected output:
Or there are multiple mutually exclusive groups:
Output:
Expected output:
(or something like).
Linked PRs