diff options
| author | Dan Davison <dandavison7@gmail.com> | 2024-08-24 08:36:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-24 08:36:10 -0400 |
| commit | 4500605bca56b746e52764f88315d4a66dac2817 (patch) | |
| tree | 9194519914f65bb6f05252f80e499829c26bfe39 | |
| parent | 6fbe197f2df7baf595443ec840eb5ee4daed1fb7 (diff) | |
Don't use a pager for --version (#1824)
| -rw-r--r-- | src/main.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index a0df151..4855dcc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,7 +24,7 @@ mod subcommands; mod tests; -use std::io::{self, ErrorKind, IsTerminal}; +use std::io::{self, ErrorKind, IsTerminal, Write}; use std::process; use bytelines::ByteLinesReader; @@ -80,7 +80,11 @@ fn run_app() -> std::io::Result<i32> { let opt = cli::Opt::from_args_and_git_config(&env, assets); let opt = match opt { - Call::Help(msg) | Call::Version(msg) => { + Call::Version(msg) => { + writeln!(std::io::stdout(), "{}", msg.trim_end())?; + return Ok(0); + } + Call::Help(msg) => { OutputType::oneshot_write(msg)?; return Ok(0); } |
