ArgGroup::requires
requires
Section titled “requires ”Specify an argument or group that must be present when this group is.
Example
Section titled “Example”name = "myprog"[groups]req_flags = { args = ["flag", "color"], requires = "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 requires: 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" ], "requires": "debug" } }, "args": { "flag": { "short": "f", "action": "set-true" }, "color": { "short": "c", "action": "set-true" }, "debug": { "short": "d", "action": "set-true" } }}
myprog -c
Output
Section titled “Output”error: the following required arguments were not provided: -d
Usage: myprog -d -c
For more information, try '--help'.