Skip to content

Commit 4500605

Browse files
authored
Don't use a pager for --version (#1824)
1 parent 6fbe197 commit 4500605

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mod subcommands;
2424

2525
mod tests;
2626

27-
use std::io::{self, ErrorKind, IsTerminal};
27+
use std::io::{self, ErrorKind, IsTerminal, Write};
2828
use std::process;
2929

3030
use bytelines::ByteLinesReader;
@@ -80,7 +80,11 @@ fn run_app() -> std::io::Result<i32> {
8080
let opt = cli::Opt::from_args_and_git_config(&env, assets);
8181

8282
let opt = match opt {
83-
Call::Help(msg) | Call::Version(msg) => {
83+
Call::Version(msg) => {
84+
writeln!(std::io::stdout(), "{}", msg.trim_end())?;
85+
return Ok(0);
86+
}
87+
Call::Help(msg) => {
8488
OutputType::oneshot_write(msg)?;
8589
return Ok(0);
8690
}

0 commit comments

Comments
 (0)