kong
kong copied to clipboard
Xor is ignored with positional arguments
I would like to do something like:
run --defaults
or:
run foo bar
but prevent:
run --defaults foo bar
It seems xor for positional arguments (flag with arg:"") does not do anything: there is no error if both are provided.
That's correct, xor is currently only applicable to flags. Seems reasonable though.
I'm trying to add a --version flag, with that flag no positional arguments are required
what would be the correct way of doing that if xor ignores positionals?
Use VersionFlag.
I have a need for this as well.
@alecthomas, you said "Seems reasonable though", but that was a while ago. Before I start diving into this, are you still open to a PR for to include positional arguments in xor?