Skip to content
Myr

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

3 files+16 added−16 removed

modified:src/main.rs+3 added-3 removed
1extern crate ansi_term;2extern crate getopts;3extern crate isatty;3extern crate atty;4extern crate regex;5extern crate ignore;67pub mod lscolors;
9 unmodified lines
17use std::path::{Path, Component};18use std::process;1920use getopts::Options;21use isatty::stdout_isatty;21use atty::Stream;22use regex::{Regex, RegexBuilder};23use ignore::WalkBuilder;2425use lscolors::LsColors;
230 unmodified lines
256 let case_sensitive = matches.opt_present("sensitive") ||257 pattern.chars().any(char::is_uppercase);258259 let colored_output = !matches.opt_present("no-color") &&260 stdout_isatty();260 atty::is(Stream::Stdout);261262 let ls_colors =263 if colored_output {264 Some(
38 unmodified lines
modified:Cargo.lock+12 added-12 removed
1 unmodified line
2name = "fd"3version = "1.1.0"4dependencies = [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]1112[[package]]
9 unmodified lines
22version = "0.9.0"23source = "registry+https://github.com/rust-lang/crates.io-index"2425[[package]]26name = "atty"27version = "0.2.2"28source = "registry+https://github.com/rust-lang/crates.io-index"29dependencies = [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]3435[[package]]36name = "crossbeam"37version = "0.2.10"38source = "registry+https://github.com/rust-lang/crates.io-index"39
34 unmodified lines
74 "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",75]7677[[package]]68name = "isatty"69version = "0.1.3"70source = "registry+https://github.com/rust-lang/crates.io-index"71dependencies = [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]7677[[package]]78name = "kernel32-sys"79version = "0.2.2"80source = "registry+https://github.com/rust-lang/crates.io-index"81dependencies = [
108 unmodified lines
190191[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 lines
modified:Cargo.toml+1 added-1 removed