Skip to content

Commit

Permalink
Merge pull request #5055 from yt2b/ls_literal_option
Browse files Browse the repository at this point in the history
ls: --l should output the same as --literal
  • Loading branch information
cakebaker committed Jul 9, 2023
2 parents 78fd0ef + cf6f785 commit 0b37b63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/uu/ls/src/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use std::time::Duration;
const LONG_ARGS: &[&str] = &[
"-l",
"--long",
"--l",
"--format=long",
"--for=long",
"--format=verbose",
Expand Down Expand Up @@ -2370,6 +2369,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\""),
Expand All @@ -2394,6 +2394,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'"),
] {
Expand Down Expand Up @@ -2455,6 +2456,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\""),
Expand Down

0 comments on commit 0b37b63

Please sign in to comment.