ArgGroup::conflicts_with
conflicts_with
Section titled “conflicts_with ”Specify an argument or group that must not be present when this group is.
Example
Section titled “Example”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" }
name: myproggroups: req_flags: args: - flag - color conflicts-with: debugargs: flag: short: f action: set-true color: short: c action: set-true debug: short: d action: set-true
{ "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" } }}
myprog -c -d
Output
Section titled “Output”error: the argument '-c' cannot be used with '-d'
Usage: myprog -c
For more information, try '--help'.