From cf6f7856e45c84acfad56c14f1b4174a1bc0d963 Mon Sep 17 00:00:00 2001 From: yt2b Date: Sat, 8 Jul 2023 10:43:20 +0900 Subject: [PATCH] ls: fix --l option --- src/uu/ls/src/ls.rs | 1 + tests/by-util/test_ls.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index 342c52cbac..f45fa0cd6e 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -1202,6 +1202,7 @@ pub fn uu_app() -> Command { Arg::new(options::quoting::LITERAL) .short('N') .long(options::quoting::LITERAL) + .alias("l") .help("Use literal quoting style. Equivalent to `--quoting-style=literal`") .overrides_with_all([ options::QUOTING_STYLE, diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index ad2c6424f6..2eef691216 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -22,7 +22,6 @@ use std::time::Duration; const LONG_ARGS: &[&str] = &[ "-l", "--long", - "--l", "--format=long", "--for=long", "--format=verbose", @@ -2411,6 +2410,7 @@ fn test_ls_quoting_style() { ("--quoting-style=literal", "one?two"), ("-N", "one?two"), ("--literal", "one?two"), + ("--l", "one?two"), ("--quoting-style=c", "\"one\\ntwo\""), ("-Q", "\"one\\ntwo\""), ("--quote-name", "\"one\\ntwo\""), @@ -2435,6 +2435,7 @@ fn test_ls_quoting_style() { ("--quoting-style=literal", "one\ntwo"), ("-N", "one\ntwo"), ("--literal", "one\ntwo"), + ("--l", "one\ntwo"), ("--quoting-style=shell", "one\ntwo"), // FIXME: GNU ls quotes this case ("--quoting-style=shell-always", "'one\ntwo'"), ] { @@ -2496,6 +2497,7 @@ fn test_ls_quoting_style() { ("--quoting-style=literal", "one two"), ("-N", "one two"), ("--literal", "one two"), + ("--l", "one two"), ("--quoting-style=c", "\"one two\""), ("-Q", "\"one two\""), ("--quote-name", "\"one two\""),