Skip to main content

run_from_args

Function run_from_args 

Source
pub fn run_from_args<I, T>(args: I) -> Result<i32>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,
Expand description

Parse explicit args, detect current dir, dispatch, return exit code.

args must include argv[0] as first item.

ยงErrors

Returns an error when reading current dir fails, project detection fails, command execution fails, or writing clap output fails.

Argument parsing/help/version flows are rendered by clap and returned as an exit code instead of terminating the host process.