fix exit code (#5835)

* fix exit code

* fix usage

* add comment
This commit is contained in:
WindSoilder
2022-06-20 22:05:11 +08:00
committed by GitHub
parent dbcfcdae89
commit fab3f8fd40
4 changed files with 33 additions and 7 deletions

View File

@ -237,7 +237,11 @@ fn main() -> Result<()> {
if is_perf_true() {
info!("-c command execution {}:{}:{}", file!(), line!(), column!());
}
ret_val
match ret_val {
Ok(Some(exit_code)) => std::process::exit(exit_code as i32),
Ok(None) => Ok(()),
Err(e) => Err(e),
}
} else if !script_name.is_empty() && binary_args.interactive_shell.is_none() {
#[cfg(feature = "plugin")]
read_plugin_file(