mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
ls: Fix clippy warning
This commit is contained in:
parent
e30f191579
commit
6760d63539
1 changed files with 5 additions and 6 deletions
|
@ -709,17 +709,16 @@ fn extract_quoting_style(options: &clap::ArgMatches, show_control: bool) -> Quot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// By default, `ls` uses Literal quoting when
|
// By default, `ls` uses Shell escape quoting style when writing to a terminal file
|
||||||
// writing to a non-terminal file descriptor
|
// descriptor and Literal otherwise.
|
||||||
if !std::io::stdout().is_terminal() {
|
if std::io::stdout().is_terminal() {
|
||||||
QuotingStyle::Literal { show_control }
|
|
||||||
} else {
|
|
||||||
// TODO: use environment variable if available
|
|
||||||
QuotingStyle::Shell {
|
QuotingStyle::Shell {
|
||||||
escape: true,
|
escape: true,
|
||||||
always_quote: false,
|
always_quote: false,
|
||||||
show_control,
|
show_control,
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
QuotingStyle::Literal { show_control }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue