Skip to content

Arg::required

since 0.1.0

Specifies that the argument must be present.

name = "prog"
[args]
cfg = { long = "config", required = true, action = "set" }
Terminal window
prog --config file.conf
Terminal window
claptrap_cfg='file.conf'
name = "prog"
[args]
cfg = { long = "config", required = true, 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'.