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"
Let some arguments depend on other arguments.
For example, disable or hide
colorifcoloredis False.Syntax is still unclear, could also be:
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.