Command::infer_long_args
infer_long_args
Section titled “infer_long_args ”Allow partial matches of long arguments or their aliases.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”name = "myprog"infer-long-args = true[args]test = { long = "test", action = "set-true" }temp = { long = "temp", action = "set-true" }
name: myproginfer-long-args: trueargs: test: long: test action: set-true temp: long: temp action: set-true
{ "name": "myprog", "infer-long-args": true, "args": { "test": { "long": "test", "action": "set-true" }, "temp": { "long": "temp", "action": "set-true" } }}
myprog --te
Output
Section titled “Output”error: unexpected argument '--te' found
tip: a similar argument exists: '--temp'
Usage: myprog --temp
For more information, try '--help'.
Example 2
Section titled “Example 2”name = "myprog"infer-long-args = true[args]test = { long = "test", action = "set-true" }
name: myproginfer-long-args: trueargs: test: long: test action: set-true
{ "name": "myprog", "infer-long-args": true, "args": { "test": { "long": "test", "action": "set-true" } }}
myprog --te
Output
Section titled “Output”claptrap_test='true'