Function parse_cli_args

Source
fn parse_cli_args<I, T>(itr: I) -> Result<Args, (i32, String)>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,
Expand description

Parse given iterator with our clap Args and handle help/version cases.

Returns: (status code, message) If the status code != 0, the message is an error message.

Cases:

  • On successful parse, returns Ok(Args)
  • On help/version, returns Err((0, msg))
  • On general errors, returns Err((1, formatted_error_msg))