Function signal_gen_cjds66_lib::error::get_code[][src]

pub fn get_code(kind: ErrorKind) -> i32
Expand description

Get an exit code for each kind of error. This code is suitable for passing back to the parent shell or execution environment as an exit value, to facilitate proper error checking when using this library’s functions with advanced scripting, such as with a bash script, Windows batch file, or PowerShell script.

“kind” parameter, accepts any clap::ErrorKind value, and then the function returns the associated number:

InvalidValue => 1
UnknownArgument => 2
InvalidSubcommand => 3
UnrecognizedSubcommand => 4
EmptyValue => 5
ValueValidation => 6
TooManyValues => 7
TooFewValues => 8
WrongNumberOfValues => 9
ArgumentConflict => 10
MissingRequiredArgument => 11
MissingSubcommand => 12
MissingArgumentOrSubcommand => 13
UnexpectedMultipleUsage => 14
InvalidUtf8 => 15
HelpDisplayed => 16
VersionDisplayed => 17
ArgumentNotFound => 18
Io => 19
Format => 20