mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
ls: add new optional arguments to --classify flag (#3041)
* ls: add new optional arguments to --classify flag The --classify flag in ls now takes an option when argument that may have the values always, auto and none. Modified clap argument to allow an optional parameter and changed the classify flag value parsing logic to account for this change. * ls: add test for indicator-style, ind and classify with value none * ls: require option paramter to --classify to use a = to specify flag value * ls: account for all the undocumented possible values for the --classify flag Added the other values for the --classify flag along with modifications to tests. Also documented the inconsistency between GNU coreutils because we accept the flag value even for the short version of the flag.
This commit is contained in:
parent
e5be9c1aaf
commit
3f6fe7f388
2 changed files with 54 additions and 3 deletions
|
@ -1555,6 +1555,9 @@ fn test_ls_indicator_style() {
|
|||
"--indicator-style=slash",
|
||||
"--ind=slash",
|
||||
"--classify",
|
||||
"--classify=always",
|
||||
"--classify=yes",
|
||||
"--classify=force",
|
||||
"--class",
|
||||
"--file-type",
|
||||
"--file",
|
||||
|
@ -1564,6 +1567,24 @@ fn test_ls_indicator_style() {
|
|||
scene.ucmd().arg(opt).succeeds().stdout_contains(&"/");
|
||||
}
|
||||
|
||||
// Classify, Indicator options should not contain any indicators when value is none.
|
||||
for opt in [
|
||||
"--indicator-style=none",
|
||||
"--ind=none",
|
||||
"--classify=none",
|
||||
"--classify=never",
|
||||
"--classify=no",
|
||||
] {
|
||||
// Verify that there are no indicators for any of the file types.
|
||||
scene
|
||||
.ucmd()
|
||||
.arg(opt)
|
||||
.succeeds()
|
||||
.stdout_does_not_contain(&"/")
|
||||
.stdout_does_not_contain(&"@")
|
||||
.stdout_does_not_contain(&"|");
|
||||
}
|
||||
|
||||
// Classify and File-Type all contain indicators for pipes and links.
|
||||
let options = vec!["classify", "file-type"];
|
||||
for opt in options {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue