coreutils
coreutils copied to clipboard
ls: Compatibility Tracking Issue
I've made an overview of all options that need to be added and defaults that need to be changed in ls to reach full compatibility with GNU ls. I hope this might help people out who want to contribute, without adding to many issues to the issue list.
The items marked with :one: are the ones I think make Good First Issues.
- [x] Formats
- [x]
-x&--format=across&--format=horizontal - [x]
-m&--format=commas - [x] Make
-noverrideable (similar to-oand-g)
- [x]
- [ ] Date & time
- [x]
--time=birth&--time=creation - [x]
--time-style=full-iso - [x]
--time-style=long-iso - [x]
--time-style=iso - [ ]
--time-style=locale(works, but not locale-specific yet) - [ ]
--time-style=+FORMATlike indate - [ ]
posix-prefix for--time-style - [x]
--full-time - [x] Default: follow environment variable
TIME_STYLEorlocale
- [x]
- [ ] Escaping and quoting
- [x]
-b.--escape&--quoting-style=escape - [x]
-Q,--quote-name&--quoting-style=c - [x]
-N,--literal&--quoting-style=literal - [x]
--quoting-style=shell&--quoting-style=shell-always - [x]
--quoting-style=shell-escape&--quoting-style=shell-escape-always - [ ]
--quoting-style=locale - [ ]
--quoting-style=clocale - [x] Default: follow environment variable
QUOTING_STYLEorshell-escape. - [x] Space in front of file names without quotes if there are names with quotes.
- [x]
- [x] Control characters
- [x]
-q&--hide-control-characters - [x]
--show-control-characters - [x] Set default to
-qif the output is a terminal.
- [x]
- [ ] Sorting
- [x]
-U&--sort=none - [x]
-v&--sort=version(also used insort, so might make sense to put this inuucore) - [x]
-X&--sort=extension - [ ] Make sorting by name locale-specific (currently only C-locale is implemented). Among other problems, this causes a behaviour where hidden files (prefixed with ".") are sorted before other files, instead of the leading "." being ignored.
- [x] :one:
--group-directories-first - [ ]
-f(enable-aU, disable-ls --color)
- [x]
- [x] Dereferencing
- [x]
-H&--dereference-command-line - [x]
--dereference-command-line-symlink-to-dir
- [x]
- [x] Hiding
- [x]
--hide - [x]
-I&--ignore
- [x]
- [x] Indicator style
- [x]
--indicator-stylewith options:none,slash,file-type,classify - [x]
-p(equivalent to--indicator-style=slash) - [x]
--file-type(equivalent to--indicator-style=file-type)
- [x]
- [ ] Block size (these should mainly be implemented in
uucore, since they are used by multiple programs)- [ ]
-s&--size - [ ]
-k&--kibibytes(equivalent to--block-size=1K) - [x]
--block-size - [x] Default: Determine block size from environment variables.
- [ ]
- [ ] Loose ends: The options that didn't fit into the categories above
- [x]
-w&--width - [ ]
-T&--tabsize - [ ]
-Z&--context - [ ]
-D&--dired - [x]
--hyperlink - [x] Show total size of directories in the long format
- [x]
Bravo for this work!
Don't hesitate to create new issues as "good first bugs"!
@tertsdiepraam That's another few points to tick off
@LevitatingBusinessMan Thanks for reminding me!
@tertsdiepraam Don't forget the posix time-styles. And the TIME_STYLE environemntal variable works already.
Nice list :) - I was implementing 'total size' related feature which I noticed to be missing from output. I think it aligns with the last item in the list?
Yes, that's what that was supposed to be! I rewrote it a bit to make it clearer (hopefully). Looking forward to the PR!
Thanks for confirming - it was already clear as is, I just was double confirming.
@sylvestre did you close this by mistake?
nah, it was closed when the PR has been merged!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Set default to -q if the output is a terminal.
The IsTerminal trait was stabilized in 1.70.0 recently. So this feature should be trivial to implement once we move the minimum rust version up.
Indeed! We're also using the is_terminal crate in other utils, which has the same interface, I think. So this should be pretty easy to do.
https://github.com/uutils/coreutils/blob/main/src/uu/ls/src/ls.rs#L830-L837
Judging by this code, this is already done. Though I am not sure if it is correctly tested.
We probably can't really test it. I'll mark it as done in the list. Thanks!
was this one completed?
nope, we still have some options not passing compared to GNU