1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-15 09:41:07 +00:00
uutils-coreutils/src
Mahmoud Soltan 97a0c06ff4
Proper columns for ls -l (#2623)
* Used .as_path() and .as_str() when required:

when the argument required is a Path and not a PathBuf,
or an str and not a Path, respectively.

* Changed display_items to take Vec<PathData>, which is passed, instead of [PathData]

* Added a pad_right function.

* Implemented column-formating to mimic the behavior of GNU coreutils's ls

Added returns in display_dir_entry_size that keep track of uname and
group lengths.
Renamed variables to make more sense.
Changed display_item_long to take all the lengths it needs to render
correctly.
Implemented owner, group, and author padding right to mimic GNU ls.

* Added a todo for future quality-of-life cache addition.

* Documented display_item_long, as a first step in documenting all functions.

* Revert "Used .as_path() and .as_str() when required:"

This reverts commit b88db6a8170f827a7adc58de14acb59f19be2db1.

* Revert "Changed display_items to take Vec<PathData>, which is passed, instead of [PathData]"

This reverts commit 0c690dda8d5eb1b257afb4c74d9c2dfc1f7cc97b.

* Ran cargo fmt to get rid of Style/format `fmt` testing error.

* Added a test for `ls -l` and `ls -lan` line formats.

* Changed uname -> username for cspell. Removed extra blank line for rustfmt.
2021-08-30 23:09:16 +02:00
..
bin refactor/uucore ~ correct implementation of executable!() for multicall 2021-08-14 14:01:34 +02:00
uu Proper columns for ls -l (#2623) 2021-08-30 23:09:16 +02:00
uucore Merge branch 'master' into chmod/compat 2021-08-28 11:21:26 +02:00
uucore_procs refactor/uucore ~ make util_name and execution_phrase functions 2021-08-14 17:55:18 +02:00