Skip to content

ArgGroup::conflicts_with

since 0.1.0

Specify an argument or group that must not be present when this group is.

name = "myprog"
[groups]
req_flags = { args = ["flag", "color"], conflicts-with = "debug" }
[args]
flag = { short = 'f', action = "set-true" }
color = { short = 'c', action = "set-true" }
debug = { short = 'd', action = "set-true" }
Terminal window
myprog -c -d
Terminal window
error: the argument '-c' cannot be used with '-d'
Usage: myprog -c
For more information, try '--help'.