From ca6b360c8a2c40bec3cf04bb4c9198ad30779309 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 31 Jul 2018 13:41:49 +1200 Subject: [PATCH] Emit 0 exit code for --version and similar operations Fixes #2878 --- src/bin/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bin/main.rs b/src/bin/main.rs index 05752055e060..7faa85573520 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -172,19 +172,19 @@ fn execute(opts: &Options) -> Result { 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 { } else { io::stdout().write_all(toml.as_bytes())?; } - return Ok(1); + return Ok(0); } Operation::Stdin { input } => format_string(input, options), Operation::Format {