mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
ls: set show-control-char if stdout is terminal
This commit is contained in:
parent
83a8ec1a67
commit
c73ba1630e
1 changed files with 3 additions and 2 deletions
|
@ -382,10 +382,11 @@ impl Config {
|
||||||
#[allow(clippy::needless_bool)]
|
#[allow(clippy::needless_bool)]
|
||||||
let show_control = if options.is_present(options::HIDE_CONTROL_CHARS) {
|
let show_control = if options.is_present(options::HIDE_CONTROL_CHARS) {
|
||||||
false
|
false
|
||||||
} else if options.is_present(options::SHOW_CONTROL_CHARS) {
|
} else if options.is_present(options::SHOW_CONTROL_CHARS) || atty::is(atty::Stream::Stdout)
|
||||||
|
{
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
false // TODO: only if output is a terminal and the program is `ls`
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
let quoting_style = if let Some(style) = options.value_of(options::QUOTING_STYLE) {
|
let quoting_style = if let Some(style) = options.value_of(options::QUOTING_STYLE) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue