Arg::conflicts_with_all
conflicts_with_all
Section titled “conflicts_with_all ”This argument is mutually exclusive with the specified arguments.
Example
Section titled “Example”name = "prog"[args]cfg = { long = "config", action = "set", conflicts-with-all = ["debug", "input"] }debug = { long = "debug", action = "set-true" }input = {}
name: progargs: cfg: long: config action: set conflicts-with-all: - debug - input debug: long: debug action: set-true input: {}
{ "name": "prog", "args": { "cfg": { "long": "config", "action": "set", "conflicts-with-all": [ "debug", "input" ] }, "debug": { "long": "debug", "action": "set-true" }, "input": {} }}
prog --config file.conf file.txt
Output
Section titled “Output”error: the argument '--config <cfg>' cannot be used with '[input]'
Usage: prog --config <cfg> [input]
For more information, try '--help'.