Skip to content

Commit 02724fb

Browse files
committed
ls: Fix formatting/linting/spelling issues
1 parent 4283c9f commit 02724fb

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/uu/ls/src/ls.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,11 +620,9 @@ fn extract_quoting_style(options: &clap::ArgMatches, show_control: bool) -> Quot
620620
QuotingStyle::C {
621621
quotes: quoting_style::Quotes::Double,
622622
}
623-
} else if options.get_flag(options::DIRED) {
624-
QuotingStyle::Literal { show_control }
625-
} else if !std::io::stdout().is_terminal() {
623+
} else if options.get_flag(options::DIRED) || !std::io::stdout().is_terminal() {
626624
// By default, `ls` uses Literal quoting when
627-
// outputing to a non-terminal file descriptor
625+
// writing to a non-terminal file descriptor
628626
QuotingStyle::Literal { show_control }
629627
} else {
630628
// TODO: use environment variable if available

tests/by-util/test_ls.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,8 +2461,8 @@ fn test_ls_quoting_style() {
24612461
.arg("one\ntwo")
24622462
.succeeds()
24632463
.stdout_only("one?two\n");
2464-
// TODO: TTY-expected output, find a way to check this as well
2465-
// .stdout_only("'one'$'\\n''two'\n");
2464+
// TODO: TTY-expected output, find a way to check this as well
2465+
// .stdout_only("'one'$'\\n''two'\n");
24662466

24672467
for (arg, correct) in [
24682468
("--quoting-style=literal", "one?two"),
@@ -2550,8 +2550,8 @@ fn test_ls_quoting_style() {
25502550
.arg("one two")
25512551
.succeeds()
25522552
.stdout_only("one two\n");
2553-
// TODO: TTY-expected output
2554-
// .stdout_only("'one two'\n");
2553+
// TODO: TTY-expected output
2554+
// .stdout_only("'one two'\n");
25552555

25562556
for (arg, correct) in [
25572557
("--quoting-style=literal", "one two"),
@@ -2615,8 +2615,8 @@ fn test_ls_quoting_and_color() {
26152615
.arg("one two")
26162616
.succeeds()
26172617
.stdout_only("one two\n");
2618-
// TODO: TTY-expected output
2619-
// .stdout_only("'one two'\n");
2618+
// TODO: TTY-expected output
2619+
// .stdout_only("'one two'\n");
26202620
}
26212621

26222622
#[test]

0 commit comments

Comments
 (0)