Skip to content

cli: handle EPIPE for version subcommand #774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cli/src/cmd_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use async_trait::async_trait;
use clap::Parser;
use oxide::Client;

use crate::println_nopipe;
use crate::{context::Context, RunnableCmd};

pub mod built_info {
Expand All @@ -27,9 +28,9 @@ impl RunnableCmd for CmdVersion {
let cli_version = built_info::PKG_VERSION;
let api_version = Client::new("").api_version();

println!("Oxide CLI {}", cli_version);
println_nopipe!("Oxide CLI {}", cli_version);

println!(
println_nopipe!(
"Built from commit: {} {}",
built_info::GIT_COMMIT_HASH.unwrap(),
if matches!(built_info::GIT_DIRTY, Some(true)) {
Expand All @@ -39,7 +40,7 @@ impl RunnableCmd for CmdVersion {
}
);

println!("Oxide API: {}", api_version);
println_nopipe!("Oxide API: {}", api_version);

Ok(())
}
Expand Down
Loading