Skip to main content

run

Function run 

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

运行 CLI(入口函数)

解析命令行参数并执行对应命令,返回退出码。

§参数

  • args:命令行参数(含程序名,如 ["sz-rust", "make", "model", "User"]

§返回

  • Ok(0):成功
  • Ok(code):命令指定的退出码
  • Err(_):内部错误