Use atty instead of isatty
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by sharkdp · committed by sharkdp · parent c74c2ca · Browse files · 3 files·+16 added−16 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+16 added−16 removed
- other:+16 added−16 removed
Provenance
- Commit
1adcf76- Tree
6735222- Author
sharkdp <davidpeter@web.de>- Committer
sharkdp <davidpeter@web.de>- Parent
c74c2ca
3 files changed+16 added−16 removed
modified:src/main.rs+3 added-3 removed
1 extern crate ansi_term;2 extern crate getopts;3-extern crate isatty;3+extern crate atty;4 extern crate regex;5 extern crate ignore;6 7 pub mod lscolors;9 unmodified lines17 use std::path::{Path, Component};18 use std::process;19 20 use getopts::Options;21-use isatty::stdout_isatty;21+use atty::Stream;22 use regex::{Regex, RegexBuilder};23 use ignore::WalkBuilder;24 25 use lscolors::LsColors;230 unmodified lines256 let case_sensitive = matches.opt_present("sensitive") ||257 pattern.chars().any(char::is_uppercase);258 259 let colored_output = !matches.opt_present("no-color") &&260- stdout_isatty();260+ atty::is(Stream::Stdout);261 262 let ls_colors =263 if colored_output {264 Some(38 unmodified linesmodified:Cargo.lock+12 added-12 removed
1 unmodified line2 name = "fd"3 version = "1.1.0"4 dependencies = [5 "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",6+ "atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",7 "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",8 "ignore 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",8- "isatty 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",9 "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",10 ]11 12 [[package]]9 unmodified lines22 version = "0.9.0"23 source = "registry+https://github.com/rust-lang/crates.io-index"24 25 [[package]]26+name = "atty"27+version = "0.2.2"28+source = "registry+https://github.com/rust-lang/crates.io-index"29+dependencies = [30+ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",31+ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",32+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",33+]34+35+[[package]]36 name = "crossbeam"37 version = "0.2.10"38 source = "registry+https://github.com/rust-lang/crates.io-index"39 34 unmodified lines74 "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",75 ]76 77 [[package]]68-name = "isatty"69-version = "0.1.3"70-source = "registry+https://github.com/rust-lang/crates.io-index"71-dependencies = [72- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",73- "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",74- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",75-]76-77-[[package]]78 name = "kernel32-sys"79 version = "0.2.2"80 source = "registry+https://github.com/rust-lang/crates.io-index"81 dependencies = [108 unmodified lines190 191 [metadata]192 "checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699"193 "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"194+"checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159"195 "checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97"196 "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344"197 "checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"198 "checksum globset 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "feeb1b6840809ef5efcf7a4a990bc4e1b7ee3df8cf9e2379a75aeb2ba42ac9c3"199 "checksum ignore 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9bda0eaa44a060e21581315efb449e7fabceb93cf38c8376dd1b7e0623e07844"199-"checksum isatty 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fa500db770a99afe2a0f2229be2a3d09c7ed9d7e4e8440bf71253141994e240f"200 "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"201 "checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf"202 "checksum libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)" = "babb8281da88cba992fa1f4ddec7d63ed96280a1a53ec9b919fd37b53d71e502"203 "checksum log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5141eca02775a762cc6cd564d8d2c50f67c0ea3a372cbf1c51592b3e029e10ad"12 unmodified linesmodified:Cargo.toml+1 added-1 removed
4 unmodified lines56789910114 unmodified lines
[dependencies]ansi_term = "0.9"getopts = "0.2"isatty = "0.1"atty = "0.2"regex = "0.2"ignore = "0.2"