mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Migrate from atty
to is-terminal
(#4382)
This commit is contained in:
parent
4e7ae2d46a
commit
7d7b9eb49a
18 changed files with 161 additions and 70 deletions
162
Cargo.lock
generated
162
Cargo.lock
generated
|
@ -67,7 +67,7 @@ version = "0.2.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi",
|
"hermit-abi 0.1.19",
|
||||||
"libc",
|
"libc",
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
@ -293,7 +293,7 @@ dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libc",
|
"libc",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -321,7 +321,6 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
|
||||||
name = "coreutils"
|
name = "coreutils"
|
||||||
version = "0.0.17"
|
version = "0.0.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
"clap_complete",
|
"clap_complete",
|
||||||
|
@ -329,6 +328,7 @@ dependencies = [
|
||||||
"filetime",
|
"filetime",
|
||||||
"glob",
|
"glob",
|
||||||
"hex-literal",
|
"hex-literal",
|
||||||
|
"is-terminal",
|
||||||
"libc",
|
"libc",
|
||||||
"nix",
|
"nix",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
@ -635,7 +635,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1631ca6e3c59112501a9d87fd86f21591ff77acd31331e8a73f8d80a65bbdd71"
|
checksum = "1631ca6e3c59112501a9d87fd86f21591ff77acd31331e8a73f8d80a65bbdd71"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nix",
|
"nix",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -834,7 +834,7 @@ dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall",
|
"redox_syscall",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1045,6 +1045,12 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hermit-abi"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hex"
|
name = "hex"
|
||||||
version = "0.4.3"
|
version = "0.4.3"
|
||||||
|
@ -1139,6 +1145,28 @@ version = "0.7.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074"
|
checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "io-lifetimes"
|
||||||
|
version = "1.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"windows-sys 0.45.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "is-terminal"
|
||||||
|
version = "0.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi 0.3.1",
|
||||||
|
"io-lifetimes 1.0.5",
|
||||||
|
"rustix 0.36.8",
|
||||||
|
"windows-sys 0.45.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itertools"
|
name = "itertools"
|
||||||
version = "0.10.5"
|
version = "0.10.5"
|
||||||
|
@ -1235,6 +1263,12 @@ version = "0.0.46"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d"
|
checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "linux-raw-sys"
|
||||||
|
version = "0.1.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lock_api"
|
name = "lock_api"
|
||||||
version = "0.4.9"
|
version = "0.4.9"
|
||||||
|
@ -1326,7 +1360,7 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"wasi",
|
"wasi",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1415,7 +1449,7 @@ version = "1.14.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5"
|
checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi",
|
"hermit-abi 0.1.19",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1545,7 +1579,7 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall",
|
"redox_syscall",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1693,7 +1727,7 @@ dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"hex",
|
"hex",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"rustix",
|
"rustix 0.35.13",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1899,10 +1933,24 @@ checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"errno",
|
"errno",
|
||||||
"io-lifetimes",
|
"io-lifetimes 0.7.5",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys",
|
"linux-raw-sys 0.0.46",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustix"
|
||||||
|
version = "0.36.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"errno",
|
||||||
|
"io-lifetimes 1.0.5",
|
||||||
|
"libc",
|
||||||
|
"linux-raw-sys 0.1.4",
|
||||||
|
"windows-sys 0.45.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2161,8 +2209,8 @@ version = "0.2.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "40ca90c434fd12083d1a6bdcbe9f92a14f96c8a1ba600ba451734ac334521f7a"
|
checksum = "40ca90c434fd12083d1a6bdcbe9f92a14f96c8a1ba600ba451734ac334521f7a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustix",
|
"rustix 0.35.13",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2334,8 +2382,8 @@ dependencies = [
|
||||||
name = "uu_cat"
|
name = "uu_cat"
|
||||||
version = "0.0.17"
|
version = "0.0.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
|
||||||
"clap",
|
"clap",
|
||||||
|
"is-terminal",
|
||||||
"nix",
|
"nix",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2432,9 +2480,9 @@ dependencies = [
|
||||||
name = "uu_cut"
|
name = "uu_cut"
|
||||||
version = "0.0.17"
|
version = "0.0.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
|
||||||
"bstr",
|
"bstr",
|
||||||
"clap",
|
"clap",
|
||||||
|
"is-terminal",
|
||||||
"memchr",
|
"memchr",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2447,7 +2495,7 @@ dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2503,7 +2551,7 @@ dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"glob",
|
"glob",
|
||||||
"uucore",
|
"uucore",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2634,7 +2682,7 @@ dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"hostname",
|
"hostname",
|
||||||
"uucore",
|
"uucore",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2705,10 +2753,10 @@ dependencies = [
|
||||||
name = "uu_ls"
|
name = "uu_ls"
|
||||||
version = "0.0.17"
|
version = "0.0.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
"glob",
|
"glob",
|
||||||
|
"is-terminal",
|
||||||
"lscolors",
|
"lscolors",
|
||||||
"number_prefix",
|
"number_prefix",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
@ -2759,9 +2807,9 @@ dependencies = [
|
||||||
name = "uu_more"
|
name = "uu_more"
|
||||||
version = "0.0.17"
|
version = "0.0.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
|
||||||
"clap",
|
"clap",
|
||||||
"crossterm",
|
"crossterm",
|
||||||
|
"is-terminal",
|
||||||
"nix",
|
"nix",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
|
@ -2801,8 +2849,8 @@ dependencies = [
|
||||||
name = "uu_nohup"
|
name = "uu_nohup"
|
||||||
version = "0.0.17"
|
version = "0.0.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
|
||||||
"clap",
|
"clap",
|
||||||
|
"is-terminal",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2936,7 +2984,7 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3079,7 +3127,7 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"nix",
|
"nix",
|
||||||
"uucore",
|
"uucore",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3097,16 +3145,16 @@ dependencies = [
|
||||||
name = "uu_tail"
|
name = "uu_tail"
|
||||||
version = "0.0.17"
|
version = "0.0.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
|
||||||
"clap",
|
"clap",
|
||||||
"fundu",
|
"fundu",
|
||||||
|
"is-terminal",
|
||||||
"libc",
|
"libc",
|
||||||
"memchr",
|
"memchr",
|
||||||
"notify",
|
"notify",
|
||||||
"same-file",
|
"same-file",
|
||||||
"uucore",
|
"uucore",
|
||||||
"winapi-util",
|
"winapi-util",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3146,7 +3194,7 @@ dependencies = [
|
||||||
"filetime",
|
"filetime",
|
||||||
"time",
|
"time",
|
||||||
"uucore",
|
"uucore",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3186,8 +3234,8 @@ dependencies = [
|
||||||
name = "uu_tty"
|
name = "uu_tty"
|
||||||
version = "0.0.17"
|
version = "0.0.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
|
||||||
"clap",
|
"clap",
|
||||||
|
"is-terminal",
|
||||||
"nix",
|
"nix",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -3282,7 +3330,7 @@ dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3316,7 +3364,7 @@ dependencies = [
|
||||||
"walkdir",
|
"walkdir",
|
||||||
"wild",
|
"wild",
|
||||||
"winapi-util",
|
"winapi-util",
|
||||||
"windows-sys",
|
"windows-sys 0.42.0",
|
||||||
"z85",
|
"z85",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3478,46 +3526,70 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_gnullvm"
|
name = "windows-sys"
|
||||||
version = "0.42.0"
|
version = "0.45.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
|
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
|
||||||
|
dependencies = [
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-targets"
|
||||||
|
version = "0.42.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"
|
||||||
|
dependencies = [
|
||||||
|
"windows_aarch64_gnullvm",
|
||||||
|
"windows_aarch64_msvc",
|
||||||
|
"windows_i686_gnu",
|
||||||
|
"windows_i686_msvc",
|
||||||
|
"windows_x86_64_gnu",
|
||||||
|
"windows_x86_64_gnullvm",
|
||||||
|
"windows_x86_64_msvc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_gnullvm"
|
||||||
|
version = "0.42.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.42.0"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
|
checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.42.0"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
|
checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.42.0"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
|
checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.42.0"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
|
checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnullvm"
|
name = "windows_x86_64_gnullvm"
|
||||||
version = "0.42.0"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
|
checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.42.0"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
|
checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xattr"
|
name = "xattr"
|
||||||
|
|
|
@ -263,7 +263,6 @@ feat_os_windows_legacy = [
|
||||||
test = [ "uu_test" ]
|
test = [ "uu_test" ]
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
atty = "0.2"
|
|
||||||
bigdecimal = "0.3"
|
bigdecimal = "0.3"
|
||||||
binary-heap-plus = "0.5.0"
|
binary-heap-plus = "0.5.0"
|
||||||
bstr = "1.0"
|
bstr = "1.0"
|
||||||
|
@ -287,6 +286,7 @@ gcd = "2.2"
|
||||||
glob = "0.3.0"
|
glob = "0.3.0"
|
||||||
half = "2.1"
|
half = "2.1"
|
||||||
indicatif = "0.17"
|
indicatif = "0.17"
|
||||||
|
is-terminal = "0.4.3"
|
||||||
itertools = "0.10.0"
|
itertools = "0.10.0"
|
||||||
libc = "0.2.139"
|
libc = "0.2.139"
|
||||||
lscolors = { version = "0.13.0", default-features=false, features = ["nu-ansi-term"] }
|
lscolors = { version = "0.13.0", default-features=false, features = ["nu-ansi-term"] }
|
||||||
|
@ -476,7 +476,7 @@ time = { workspace=true, features=["local-offset"] }
|
||||||
unindent = "0.1"
|
unindent = "0.1"
|
||||||
uucore = { workspace=true, features=["entries", "process", "signals"] }
|
uucore = { workspace=true, features=["entries", "process", "signals"] }
|
||||||
walkdir = { workspace=true }
|
walkdir = { workspace=true }
|
||||||
atty = { workspace=true }
|
is-terminal = { workspace=true }
|
||||||
hex-literal = "0.3.1"
|
hex-literal = "0.3.1"
|
||||||
rstest = "0.16.0"
|
rstest = "0.16.0"
|
||||||
|
|
||||||
|
|
14
deny.toml
14
deny.toml
|
@ -58,12 +58,24 @@ highlight = "all"
|
||||||
# For each duplicate dependency, indicate the name of the dependency which
|
# For each duplicate dependency, indicate the name of the dependency which
|
||||||
# introduces it.
|
# introduces it.
|
||||||
# spell-checker: disable
|
# spell-checker: disable
|
||||||
skip = []
|
skip = [
|
||||||
|
# is-terminal
|
||||||
|
{ name = "hermit-abi", version = "0.3.1" },
|
||||||
|
# is-terminal
|
||||||
|
{ name = "rustix", version = "0.36.8" },
|
||||||
|
# is-terminal (via rustix)
|
||||||
|
{ name = "io-lifetimes", version = "1.0.5" },
|
||||||
|
# is-terminal
|
||||||
|
{ name = "linux-raw-sys", version = "0.1.4" },
|
||||||
|
# is-terminal
|
||||||
|
{ name = "windows-sys", version = "0.45.0" },
|
||||||
|
]
|
||||||
# spell-checker: enable
|
# spell-checker: enable
|
||||||
|
|
||||||
# This section is considered when running `cargo deny check sources`.
|
# This section is considered when running `cargo deny check sources`.
|
||||||
# More documentation about the 'sources' section can be found here:
|
# More documentation about the 'sources' section can be found here:
|
||||||
# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html
|
# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html
|
||||||
|
|
||||||
[sources]
|
[sources]
|
||||||
unknown-registry = "warn"
|
unknown-registry = "warn"
|
||||||
unknown-git = "warn"
|
unknown-git = "warn"
|
||||||
|
|
|
@ -17,7 +17,7 @@ path = "src/cat.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { workspace=true }
|
clap = { workspace=true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
atty = { 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]
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
// 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, Read, Write};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
@ -332,7 +333,7 @@ fn cat_path(
|
||||||
let stdin = io::stdin();
|
let stdin = io::stdin();
|
||||||
let mut handle = InputHandle {
|
let mut handle = InputHandle {
|
||||||
reader: stdin,
|
reader: stdin,
|
||||||
is_interactive: atty::is(atty::Stream::Stdin),
|
is_interactive: std::io::stdin().is_terminal(),
|
||||||
};
|
};
|
||||||
cat_handle(&mut handle, options, state)
|
cat_handle(&mut handle, options, state)
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ clap = { workspace=true }
|
||||||
uucore = { workspace=true }
|
uucore = { workspace=true }
|
||||||
memchr = { workspace=true }
|
memchr = { workspace=true }
|
||||||
bstr = { workspace=true }
|
bstr = { workspace=true }
|
||||||
atty = { workspace=true }
|
is-terminal = { workspace=true }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "cut"
|
name = "cut"
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
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, Read, Write};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
@ -136,7 +137,7 @@ enum Mode {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stdout_writer() -> Box<dyn Write> {
|
fn stdout_writer() -> Box<dyn Write> {
|
||||||
if atty::is(atty::Stream::Stdout) {
|
if std::io::stdout().is_terminal() {
|
||||||
Box::new(stdout())
|
Box::new(stdout())
|
||||||
} else {
|
} else {
|
||||||
Box::new(BufWriter::new(stdout())) as Box<dyn Write>
|
Box::new(BufWriter::new(stdout())) as Box<dyn Write>
|
||||||
|
|
|
@ -25,7 +25,7 @@ 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 }
|
||||||
atty = { workspace=true }
|
is-terminal = { workspace=true }
|
||||||
selinux = { workspace=true, optional = true }
|
selinux = { workspace=true, optional = true }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -12,6 +12,7 @@ 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;
|
||||||
|
@ -451,7 +452,7 @@ impl Config {
|
||||||
(Format::Commas, Some(options::format::COMMAS))
|
(Format::Commas, Some(options::format::COMMAS))
|
||||||
} else if options.get_flag(options::format::COLUMNS) {
|
} else if options.get_flag(options::format::COLUMNS) {
|
||||||
(Format::Columns, Some(options::format::COLUMNS))
|
(Format::Columns, Some(options::format::COLUMNS))
|
||||||
} else if atty::is(atty::Stream::Stdout) {
|
} else if std::io::stdout().is_terminal() {
|
||||||
(Format::Columns, None)
|
(Format::Columns, None)
|
||||||
} else {
|
} else {
|
||||||
(Format::OneLine, None)
|
(Format::OneLine, None)
|
||||||
|
@ -557,7 +558,7 @@ impl Config {
|
||||||
None => options.contains_id(options::COLOR),
|
None => options.contains_id(options::COLOR),
|
||||||
Some(val) => match val.as_str() {
|
Some(val) => match val.as_str() {
|
||||||
"" | "always" | "yes" | "force" => true,
|
"" | "always" | "yes" | "force" => true,
|
||||||
"auto" | "tty" | "if-tty" => atty::is(atty::Stream::Stdout),
|
"auto" | "tty" | "if-tty" => std::io::stdout().is_terminal(),
|
||||||
/* "never" | "no" | "none" | */ _ => false,
|
/* "never" | "no" | "none" | */ _ => false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -678,7 +679,7 @@ impl Config {
|
||||||
} else if options.get_flag(options::SHOW_CONTROL_CHARS) {
|
} else if options.get_flag(options::SHOW_CONTROL_CHARS) {
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
!atty::is(atty::Stream::Stdout)
|
!std::io::stdout().is_terminal()
|
||||||
};
|
};
|
||||||
|
|
||||||
let opt_quoting_style = options
|
let opt_quoting_style = options
|
||||||
|
@ -750,7 +751,7 @@ impl Config {
|
||||||
"never" | "no" | "none" => IndicatorStyle::None,
|
"never" | "no" | "none" => IndicatorStyle::None,
|
||||||
"always" | "yes" | "force" => IndicatorStyle::Classify,
|
"always" | "yes" | "force" => IndicatorStyle::Classify,
|
||||||
"auto" | "tty" | "if-tty" => {
|
"auto" | "tty" | "if-tty" => {
|
||||||
if atty::is(atty::Stream::Stdout) {
|
if std::io::stdout().is_terminal() {
|
||||||
IndicatorStyle::Classify
|
IndicatorStyle::Classify
|
||||||
} else {
|
} else {
|
||||||
IndicatorStyle::None
|
IndicatorStyle::None
|
||||||
|
|
|
@ -18,7 +18,7 @@ path = "src/more.rs"
|
||||||
clap = { workspace=true }
|
clap = { workspace=true }
|
||||||
uucore = { workspace=true }
|
uucore = { workspace=true }
|
||||||
crossterm = { workspace=true }
|
crossterm = { workspace=true }
|
||||||
atty = { workspace=true }
|
is-terminal = { workspace=true }
|
||||||
unicode-width = { workspace=true }
|
unicode-width = { workspace=true }
|
||||||
unicode-segmentation = { workspace=true }
|
unicode-segmentation = { workspace=true }
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ use crossterm::{
|
||||||
terminal,
|
terminal,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
@ -83,7 +84,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
buff.clear();
|
buff.clear();
|
||||||
}
|
}
|
||||||
reset_term(&mut stdout);
|
reset_term(&mut stdout);
|
||||||
} else if atty::isnt(atty::Stream::Stdin) {
|
} else if !std::io::stdin().is_terminal() {
|
||||||
stdin().read_to_string(&mut buff).unwrap();
|
stdin().read_to_string(&mut buff).unwrap();
|
||||||
let mut stdout = setup_term();
|
let mut stdout = setup_term();
|
||||||
more(&buff, &mut stdout, None, silent)?;
|
more(&buff, &mut stdout, None, silent)?;
|
||||||
|
|
|
@ -17,7 +17,7 @@ path = "src/nohup.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { workspace=true }
|
clap = { workspace=true }
|
||||||
libc = { workspace=true }
|
libc = { workspace=true }
|
||||||
atty = { workspace=true }
|
is-terminal = { workspace=true }
|
||||||
uucore = { workspace=true, features=["fs"] }
|
uucore = { workspace=true, features=["fs"] }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
// 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;
|
||||||
|
@ -129,7 +130,7 @@ pub fn uu_app() -> Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn replace_fds() -> UResult<()> {
|
fn replace_fds() -> UResult<()> {
|
||||||
if atty::is(atty::Stream::Stdin) {
|
if std::io::stdin().is_terminal() {
|
||||||
let new_stdin = File::open(Path::new("/dev/null"))
|
let new_stdin = File::open(Path::new("/dev/null"))
|
||||||
.map_err(|e| NohupError::CannotReplace("STDIN", e))?;
|
.map_err(|e| NohupError::CannotReplace("STDIN", e))?;
|
||||||
if unsafe { dup2(new_stdin.as_raw_fd(), 0) } != 0 {
|
if unsafe { dup2(new_stdin.as_raw_fd(), 0) } != 0 {
|
||||||
|
@ -137,7 +138,7 @@ fn replace_fds() -> UResult<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if atty::is(atty::Stream::Stdout) {
|
if std::io::stdout().is_terminal() {
|
||||||
let new_stdout = find_stdout()?;
|
let new_stdout = find_stdout()?;
|
||||||
let fd = new_stdout.as_raw_fd();
|
let fd = new_stdout.as_raw_fd();
|
||||||
|
|
||||||
|
@ -146,7 +147,7 @@ fn replace_fds() -> UResult<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if atty::is(atty::Stream::Stderr) && unsafe { dup2(1, 2) } != 2 {
|
if std::io::stderr().is_terminal() && unsafe { dup2(1, 2) } != 2 {
|
||||||
return Err(NohupError::CannotReplace("STDERR", Error::last_os_error()).into());
|
return Err(NohupError::CannotReplace("STDERR", Error::last_os_error()).into());
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -22,7 +22,7 @@ memchr = { workspace=true }
|
||||||
notify = { workspace=true }
|
notify = { workspace=true }
|
||||||
uucore = { workspace=true }
|
uucore = { workspace=true }
|
||||||
same-file = { workspace=true }
|
same-file = { workspace=true }
|
||||||
atty = { workspace=true }
|
is-terminal = { workspace=true }
|
||||||
fundu = { workspace=true }
|
fundu = { workspace=true }
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
|
|
||||||
use crate::paths::Input;
|
use crate::paths::Input;
|
||||||
use crate::{parse, platform, Quotable};
|
use crate::{parse, platform, Quotable};
|
||||||
use atty::Stream;
|
|
||||||
use clap::crate_version;
|
use clap::crate_version;
|
||||||
use clap::{parser::ValueSource, Arg, ArgAction, ArgMatches, Command};
|
use clap::{parser::ValueSource, Arg, ArgAction, ArgMatches, Command};
|
||||||
use fundu::DurationParser;
|
use fundu::DurationParser;
|
||||||
|
use is_terminal::IsTerminal;
|
||||||
use same_file::Handle;
|
use same_file::Handle;
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
|
@ -274,7 +274,7 @@ impl Settings {
|
||||||
.map_or(false, |meta| !meta.is_file())
|
.map_or(false, |meta| !meta.is_file())
|
||||||
});
|
});
|
||||||
|
|
||||||
if !blocking_stdin && atty::is(Stream::Stdin) {
|
if !blocking_stdin && std::io::stdin().is_terminal() {
|
||||||
show_warning!("following standard input indefinitely is ineffective");
|
show_warning!("following standard input indefinitely is ineffective");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ path = "src/tty.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { workspace=true }
|
clap = { workspace=true }
|
||||||
nix = { workspace=true, features=["term"] }
|
nix = { workspace=true, features=["term"] }
|
||||||
atty = { workspace=true }
|
is-terminal = { workspace=true }
|
||||||
uucore = { workspace=true, features=["fs"] }
|
uucore = { workspace=true, features=["fs"] }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -10,6 +10,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::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};
|
||||||
|
@ -30,7 +31,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
|
|
||||||
// If silent, we don't need the name, only whether or not stdin is a tty.
|
// If silent, we don't need the name, only whether or not stdin is a tty.
|
||||||
if silent {
|
if silent {
|
||||||
return if atty::is(atty::Stream::Stdin) {
|
return if std::io::stdin().is_terminal() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(1.into())
|
Err(1.into())
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
use crate::common::util::*;
|
use crate::common::util::*;
|
||||||
|
use is_terminal::IsTerminal;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_more_no_arg() {
|
fn test_more_no_arg() {
|
||||||
// Reading from stdin is now supported, so this must succeed
|
// Reading from stdin is now supported, so this must succeed
|
||||||
if atty::is(atty::Stream::Stdout) {
|
if std::io::stdout().is_terminal() {
|
||||||
new_ucmd!().succeeds();
|
new_ucmd!().succeeds();
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
@ -14,7 +15,7 @@ fn test_more_dir_arg() {
|
||||||
// Run the test only if there's a valid terminal, else do nothing
|
// Run the test only if there's a valid terminal, else do nothing
|
||||||
// Maybe we could capture the error, i.e. "Device not found" in that case
|
// Maybe we could capture the error, i.e. "Device not found" in that case
|
||||||
// but I am leaving this for later
|
// but I am leaving this for later
|
||||||
if atty::is(atty::Stream::Stdout) {
|
if std::io::stdout().is_terminal() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.arg(".")
|
.arg(".")
|
||||||
.fails()
|
.fails()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue