diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2018-07-31 13:41:49 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2018-07-31 13:41:49 +1200 |
| commit | ca6b360c8a2c40bec3cf04bb4c9198ad30779309 (patch) | |
| tree | 76e174e8dabc86b70e0000784a2c7170a6fa543f /src | |
| parent | d43874113e6b9fc604dbacfd202d2a913a11fef4 (diff) | |
Emit 0 exit code for --version and similar operations
Fixes #2878
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs index 05752055e06..7faa8557352 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -172,19 +172,19 @@ fn execute(opts: &Options) -> Result<i32, failure::Error> { match determine_operation(&matches)? { Operation::Help(HelpOp::None) => { print_usage_to_stdout(opts, ""); - return Ok(1); + return Ok(0); } Operation::Help(HelpOp::Config) => { Config::print_docs(&mut stdout(), options.unstable_features); - return Ok(1); + return Ok(0); } Operation::Help(HelpOp::FileLines) => { print_help_file_lines(); - return Ok(1); + return Ok(0); } Operation::Version => { print_version(); - return Ok(1); + return Ok(0); } Operation::ConfigOutputDefault { path } => { let toml = Config::default().all_options().to_toml().map_err(err_msg)?; @@ -194,7 +194,7 @@ fn execute(opts: &Options) -> Result<i32, failure::Error> { } else { io::stdout().write_all(toml.as_bytes())?; } - return Ok(1); + return Ok(0); } Operation::Stdin { input } => format_string(input, options), Operation::Format { |
