Skip to content

Arg::requires

since 0.1.0

Sets an argument that is required when this one is present.

name = "prog"
[args]
cfg = { long = "config", requires = "input", action = "set" }
input = {}
Terminal window
prog
Terminal window
name = "prog"
[args]
cfg = { long = "config", requires = "input", action = "set" }
input = {}
Terminal window
prog --config file.conf
Terminal window
error: the following required arguments were not provided:
<input>
Usage: prog --config <cfg> <input>
For more information, try '--help'.