-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Let some arguments depend on other arguments.
parser.add_argument("colored", default=False)
parser.add_argument("color", condition=lambda: parser["colored"] == True)For example, disable or hide color if colored is False.
Syntax is still unclear, could also be:
parser.add_argument("color", dependencies=["colored"])Whereby any "dependency" is tested with return bool(arg), such that each argument can override __nonzero__ and __bool__ to control the behavior.
Also needs some indication of what to do if the condition is False.
parser.add_argument("color", condition=, condition_behavior=Hide)
# Or "Disable" or "Ignore"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request