Skip to content

Arg::required_unless_present_any

since 0.1.0

Sets this arg as required unless any of the specified arguments are present at runtime.

name = "prog"
[args]
cfg = { long = "config", required-unless-present-any = ["dbg", "infile"], action = "set" }
dbg = { long = "debug", action = "set-true" }
infile = { short = 'i', action = "set" }
Terminal window
prog --debug
Terminal window
claptrap_dbg='true'
name = "prog"
[args]
cfg = { long = "config", required-unless-present-any = ["dbg", "infile"], action = "set" }
dbg = { long = "debug", action = "set-true" }
infile = { short = 'i', action = "set" }
Terminal window
prog
Terminal window
error: the following required arguments were not provided:
--config <cfg>
Usage: prog --config <cfg>
For more information, try '--help'.