1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

Use std::io::IsTerminal instead of is-terminal

This commit is contained in:
Daniel Hofstetter 2023-09-04 10:35:17 +02:00
parent 794977409a
commit 4992cb9b86
17 changed files with 8 additions and 31 deletions

8
Cargo.lock generated
View file

@ -389,7 +389,6 @@ dependencies = [
"filetime", "filetime",
"glob", "glob",
"hex-literal", "hex-literal",
"is-terminal",
"libc", "libc",
"nix", "nix",
"once_cell", "once_cell",
@ -2311,7 +2310,6 @@ name = "uu_cat"
version = "0.0.21" version = "0.0.21"
dependencies = [ dependencies = [
"clap", "clap",
"is-terminal",
"nix", "nix",
"thiserror", "thiserror",
"uucore", "uucore",
@ -2411,7 +2409,6 @@ version = "0.0.21"
dependencies = [ dependencies = [
"bstr", "bstr",
"clap", "clap",
"is-terminal",
"memchr", "memchr",
"uucore", "uucore",
] ]
@ -2679,7 +2676,6 @@ dependencies = [
"chrono", "chrono",
"clap", "clap",
"glob", "glob",
"is-terminal",
"lscolors", "lscolors",
"number_prefix", "number_prefix",
"once_cell", "once_cell",
@ -2732,7 +2728,6 @@ version = "0.0.21"
dependencies = [ dependencies = [
"clap", "clap",
"crossterm", "crossterm",
"is-terminal",
"nix", "nix",
"unicode-segmentation", "unicode-segmentation",
"unicode-width", "unicode-width",
@ -2773,7 +2768,6 @@ name = "uu_nohup"
version = "0.0.21" version = "0.0.21"
dependencies = [ dependencies = [
"clap", "clap",
"is-terminal",
"libc", "libc",
"uucore", "uucore",
] ]
@ -3072,7 +3066,6 @@ version = "0.0.21"
dependencies = [ dependencies = [
"clap", "clap",
"fundu", "fundu",
"is-terminal",
"libc", "libc",
"memchr", "memchr",
"notify", "notify",
@ -3162,7 +3155,6 @@ name = "uu_tty"
version = "0.0.21" version = "0.0.21"
dependencies = [ dependencies = [
"clap", "clap",
"is-terminal",
"nix", "nix",
"uucore", "uucore",
] ]

View file

@ -286,7 +286,6 @@ gcd = "2.3"
glob = "0.3.1" glob = "0.3.1"
half = "2.2" half = "2.2"
indicatif = "0.17" indicatif = "0.17"
is-terminal = "0.4.9"
itertools = "0.11.0" itertools = "0.11.0"
libc = "0.2.147" libc = "0.2.147"
lscolors = { version = "0.15.0", default-features = false, features = [ lscolors = { version = "0.15.0", default-features = false, features = [
@ -491,7 +490,6 @@ time = { workspace = true, features = ["local-offset"] }
unindent = "0.2" unindent = "0.2"
uucore = { workspace = true, features = ["entries", "process", "signals"] } uucore = { workspace = true, features = ["entries", "process", "signals"] }
walkdir = { workspace = true } walkdir = { workspace = true }
is-terminal = { workspace = true }
hex-literal = "0.4.1" hex-literal = "0.4.1"
rstest = { workspace = true } rstest = { workspace = true }

View file

@ -17,7 +17,6 @@ path = "src/cat.rs"
[dependencies] [dependencies]
clap = { workspace = true } clap = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
is-terminal = { workspace = true }
uucore = { workspace = true, features = ["fs", "pipes"] } uucore = { workspace = true, features = ["fs", "pipes"] }
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]

View file

@ -7,9 +7,8 @@
// last synced with: cat (GNU coreutils) 8.13 // last synced with: cat (GNU coreutils) 8.13
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{crate_version, Arg, ArgAction, Command};
use is_terminal::IsTerminal;
use std::fs::{metadata, File}; use std::fs::{metadata, File};
use std::io::{self, Read, Write}; use std::io::{self, IsTerminal, Read, Write};
use thiserror::Error; use thiserror::Error;
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::UResult; use uucore::error::UResult;

View file

@ -19,7 +19,6 @@ clap = { workspace = true }
uucore = { workspace = true, features = ["ranges"] } uucore = { workspace = true, features = ["ranges"] }
memchr = { workspace = true } memchr = { workspace = true }
bstr = { workspace = true } bstr = { workspace = true }
is-terminal = { workspace = true }
[[bin]] [[bin]]
name = "cut" name = "cut"

View file

@ -7,9 +7,8 @@
use bstr::io::BufReadExt; use bstr::io::BufReadExt;
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{crate_version, Arg, ArgAction, Command};
use is_terminal::IsTerminal;
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write}; use std::io::{stdin, stdout, BufReader, BufWriter, IsTerminal, Read, Write};
use std::path::Path; use std::path::Path;
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{FromIo, UResult, USimpleError}; use uucore::error::{FromIo, UResult, USimpleError};

View file

@ -25,7 +25,6 @@ glob = { workspace = true }
lscolors = { workspace = true } lscolors = { workspace = true }
uucore = { workspace = true, features = ["entries", "fs"] } uucore = { workspace = true, features = ["entries", "fs"] }
once_cell = { workspace = true } once_cell = { workspace = true }
is-terminal = { workspace = true }
selinux = { workspace = true, optional = true } selinux = { workspace = true, optional = true }
[[bin]] [[bin]]

View file

@ -10,12 +10,11 @@ use clap::{
crate_version, Arg, ArgAction, Command, crate_version, Arg, ArgAction, Command,
}; };
use glob::{MatchOptions, Pattern}; use glob::{MatchOptions, Pattern};
use is_terminal::IsTerminal;
use lscolors::LsColors; use lscolors::LsColors;
use number_prefix::NumberPrefix; use number_prefix::NumberPrefix;
use once_cell::unsync::OnceCell; use once_cell::unsync::OnceCell;
use std::collections::HashSet;
use std::num::IntErrorKind; use std::num::IntErrorKind;
use std::{collections::HashSet, io::IsTerminal};
#[cfg(windows)] #[cfg(windows)]
use std::os::windows::fs::MetadataExt; use std::os::windows::fs::MetadataExt;

View file

@ -18,7 +18,6 @@ path = "src/more.rs"
clap = { workspace = true } clap = { workspace = true }
uucore = { workspace = true } uucore = { workspace = true }
crossterm = { workspace = true } crossterm = { workspace = true }
is-terminal = { workspace = true }
unicode-width = { workspace = true } unicode-width = { workspace = true }
unicode-segmentation = { workspace = true } unicode-segmentation = { workspace = true }

View file

@ -7,7 +7,7 @@
use std::{ use std::{
fs::File, fs::File,
io::{stdin, stdout, BufReader, Read, Stdout, Write}, io::{stdin, stdout, BufReader, IsTerminal, Read, Stdout, Write},
path::Path, path::Path,
time::Duration, time::Duration,
}; };
@ -22,7 +22,6 @@ use crossterm::{
terminal::{self, Clear, ClearType}, terminal::{self, Clear, ClearType},
}; };
use is_terminal::IsTerminal;
use unicode_segmentation::UnicodeSegmentation; use unicode_segmentation::UnicodeSegmentation;
use unicode_width::UnicodeWidthStr; use unicode_width::UnicodeWidthStr;
use uucore::display::Quotable; use uucore::display::Quotable;

View file

@ -17,7 +17,6 @@ path = "src/nohup.rs"
[dependencies] [dependencies]
clap = { workspace = true } clap = { workspace = true }
libc = { workspace = true } libc = { workspace = true }
is-terminal = { workspace = true }
uucore = { workspace = true, features = ["fs"] } uucore = { workspace = true, features = ["fs"] }
[[bin]] [[bin]]

View file

@ -6,14 +6,13 @@
// spell-checker:ignore (ToDO) execvp SIGHUP cproc vprocmgr cstrs homeout // spell-checker:ignore (ToDO) execvp SIGHUP cproc vprocmgr cstrs homeout
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{crate_version, Arg, ArgAction, Command};
use is_terminal::IsTerminal;
use libc::{c_char, dup2, execvp, signal}; use libc::{c_char, dup2, execvp, signal};
use libc::{SIGHUP, SIG_IGN}; use libc::{SIGHUP, SIG_IGN};
use std::env; use std::env;
use std::ffi::CString; use std::ffi::CString;
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
use std::fs::{File, OpenOptions}; use std::fs::{File, OpenOptions};
use std::io::Error; use std::io::{Error, IsTerminal};
use std::os::unix::prelude::*; use std::os::unix::prelude::*;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use uucore::display::Quotable; use uucore::display::Quotable;

View file

@ -22,7 +22,6 @@ memchr = { workspace = true }
notify = { workspace = true } notify = { workspace = true }
uucore = { workspace = true } uucore = { workspace = true }
same-file = { workspace = true } same-file = { workspace = true }
is-terminal = { workspace = true }
fundu = { workspace = true } fundu = { workspace = true }
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]

View file

@ -10,9 +10,9 @@ use crate::{parse, platform, Quotable};
use clap::{crate_version, value_parser}; use clap::{crate_version, value_parser};
use clap::{Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use fundu::{DurationParser, SaturatingInto}; use fundu::{DurationParser, SaturatingInto};
use is_terminal::IsTerminal;
use same_file::Handle; use same_file::Handle;
use std::ffi::OsString; use std::ffi::OsString;
use std::io::IsTerminal;
use std::time::Duration; use std::time::Duration;
use uucore::error::{UResult, USimpleError, UUsageError}; use uucore::error::{UResult, USimpleError, UUsageError};
use uucore::parse_size::{parse_size, ParseSizeError}; use uucore::parse_size::{parse_size, ParseSizeError};

View file

@ -17,7 +17,6 @@ path = "src/tty.rs"
[dependencies] [dependencies]
clap = { workspace = true } clap = { workspace = true }
nix = { workspace = true, features = ["term"] } nix = { workspace = true, features = ["term"] }
is-terminal = { workspace = true }
uucore = { workspace = true, features = ["fs"] } uucore = { workspace = true, features = ["fs"] }
[[bin]] [[bin]]

View file

@ -8,8 +8,7 @@
// spell-checker:ignore (ToDO) ttyname filedesc // spell-checker:ignore (ToDO) ttyname filedesc
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{crate_version, Arg, ArgAction, Command};
use is_terminal::IsTerminal; use std::io::{IsTerminal, Write};
use std::io::Write;
use std::os::unix::io::AsRawFd; use std::os::unix::io::AsRawFd;
use uucore::error::{set_exit_code, UResult}; use uucore::error::{set_exit_code, UResult};
use uucore::{format_usage, help_about, help_usage}; use uucore::{format_usage, help_about, help_usage};

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use crate::common::util::TestScenario; use crate::common::util::TestScenario;
use is_terminal::IsTerminal; use std::io::IsTerminal;
#[test] #[test]
fn test_more_no_arg() { fn test_more_no_arg() {