]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - src/commands/cmd_list.rs
Replace atty with stdlib
[bcachefs-tools-debian] / src / commands / cmd_list.rs
index cb35291648fc362d46ab150ec3cf4a0163da86a3..63eba7e975127e685dc7aac5c137c65f9c1f4db5 100644 (file)
@@ -1,4 +1,3 @@
-use atty::Stream;
 use log::{error};
 use bch_bindgen::bcachefs;
 use bch_bindgen::opt_set;
@@ -9,6 +8,7 @@ use bch_bindgen::btree::BtreeIter;
 use bch_bindgen::btree::BtreeNodeIter;
 use bch_bindgen::btree::BtreeIterFlags;
 use clap::{Parser};
+use std::io::{stdout, IsTerminal};
 
 fn list_keys(fs: &Fs, opt: Cli) -> anyhow::Result<()> {
     let trans = BtreeTrans::new(fs);
@@ -117,7 +117,7 @@ pub struct Cli {
     fsck:       bool,
 
     /// Force color on/off. Default: autodetect tty
-    #[arg(short, long, action = clap::ArgAction::Set, default_value_t=atty::is(Stream::Stdout))]
+    #[arg(short, long, action = clap::ArgAction::Set, default_value_t=stdout().is_terminal())]
     colorize:   bool,
 
     /// Verbose mode