Command::disable_version_flag
disable_version_flag
Section titled “disable_version_flag ”Disables -V and —version flag.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”name = "myprog"version = "1.0.0"disable-version-flag = true[args]version = { long = "version", action = "version", help = "Print version" }
name: myprogversion: 1.0.0disable-version-flag: trueargs: version: long: version action: version help: Print version
{ "name": "myprog", "version": "1.0.0", "disable-version-flag": true, "args": { "version": { "long": "version", "action": "version", "help": "Print version" } }}
myprog -V
Output
Section titled “Output”error: unexpected argument '-V' found
Usage: myprog
For more information, try '--help'.
Example 2
Section titled “Example 2”name = "myprog"version = "1.0.0"disable-version-flag = true[args]version = { long = "version", action = "version", help = "Print version" }
name: myprogversion: 1.0.0disable-version-flag: trueargs: version: long: version action: version help: Print version
{ "name": "myprog", "version": "1.0.0", "disable-version-flag": true, "args": { "version": { "long": "version", "action": "version", "help": "Print version" } }}
myprog --version
Output
Section titled “Output”myprog 1.0.0