Skip to content

Commit

Permalink
Don't use a pager for --version
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Aug 24, 2024
1 parent f6ad0f5 commit c78f14d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit c78f14d

Please sign in to comment.