mirror of https://github.com/sharkdp/fd.git
honor the NO_COLOR env var
This commit is contained in:
parent
fc924d2e0a
commit
70448b0006
|
@ -97,6 +97,8 @@ complete (and more colorful) variants, see
|
||||||
[here](https://github.com/seebi/dircolors-solarized) or
|
[here](https://github.com/seebi/dircolors-solarized) or
|
||||||
[here](https://github.com/trapd00r/LS_COLORS).
|
[here](https://github.com/trapd00r/LS_COLORS).
|
||||||
|
|
||||||
|
`fd` also honors the [NO_COLOR](https://no-color.org/) environment variable.
|
||||||
|
|
||||||
## Parallel command execution
|
## Parallel command execution
|
||||||
If the `-x`/`--exec` option is specified alongside a command template, a job pool will be created
|
If the `-x`/`--exec` option is specified alongside a command template, a job pool will be created
|
||||||
for executing commands in parallel for each discovered path as the input. The syntax for generating
|
for executing commands in parallel for each discovered path as the input. The syntax for generating
|
||||||
|
|
|
@ -143,7 +143,7 @@ fn main() {
|
||||||
let colored_output = match matches.value_of("color") {
|
let colored_output = match matches.value_of("color") {
|
||||||
Some("always") => true,
|
Some("always") => true,
|
||||||
Some("never") => false,
|
Some("never") => false,
|
||||||
_ => atty::is(Stream::Stdout),
|
_ => env::var_os("NO_COLOR").is_none() && atty::is(Stream::Stdout),
|
||||||
};
|
};
|
||||||
|
|
||||||
let path_separator = matches.value_of("path-separator").map(|str| str.to_owned());
|
let path_separator = matches.value_of("path-separator").map(|str| str.to_owned());
|
||||||
|
|
Loading…
Reference in New Issue