From 6760d63539cd2bb8ac1e5ec345baea84a1c902a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dorian=20P=C3=A9ron?= Date: Thu, 4 Jan 2024 16:51:30 +0100 Subject: [PATCH] ls: Fix clippy warning --- src/uu/ls/src/ls.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index d56929be8..0e9b25722 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -709,17 +709,16 @@ fn extract_quoting_style(options: &clap::ArgMatches, show_control: bool) -> Quot } } - // By default, `ls` uses Literal quoting when - // writing to a non-terminal file descriptor - if !std::io::stdout().is_terminal() { - QuotingStyle::Literal { show_control } - } else { - // TODO: use environment variable if available + // By default, `ls` uses Shell escape quoting style when writing to a terminal file + // descriptor and Literal otherwise. + if std::io::stdout().is_terminal() { QuotingStyle::Shell { escape: true, always_quote: false, show_control, } + } else { + QuotingStyle::Literal { show_control } } } }