Skip to content

Commit

Permalink
Allow piping into everything
Browse files Browse the repository at this point in the history
There is a future nightly feature to avoid the unsafe use, but this is fairly innocuous to me.
Have used it in most of my CLIs before.

Signed-off-by: clux <sszynrae@gmail.com>
  • Loading branch information
clux committed Aug 31, 2023
1 parent e70acbc commit 3c9d487
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ serde = { version = "1.0.186", features = ["derive"] }
serde_yaml = "0.9.25"
heck = "0.4.1"
syn = "2.0.29"
libc = "0.2.147"

[dependencies.kube]
version = "0.85.0"
Expand Down
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ enum Command {
#[tokio::main]
async fn main() -> Result<()> {
env_logger::init();
// Ignore SIGPIPE errors to avoid having to use let _ = write! everywhere
// See https://github.com/rust-lang/rust/issues/46016
unsafe {
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
}

let mut args = Kopium::parse();
if args.auto {
args.docs = true;
Expand Down

0 comments on commit 3c9d487

Please sign in to comment.