Commit graph

302 commits

Author SHA1 Message Date
kimono-koans
fd5310411e
ls: Fix device display (#2855) 2022-01-15 00:39:56 +01:00
Terts Diepraam
c8270b202e ls: clap 3 2022-01-11 19:16:47 +01:00
kimono-koans
016d5e72ad
ls: Fix padding for dangling links in non-Long formats (#2856)
* Fix padding for dangling links in non-long formats

Co-authored-by: electricboogie <32370782+electricboogie@users.noreply.github.com>
2022-01-11 12:01:54 +01:00
Sylvestre Ledru
dcfdeb334d
Merge pull request #2854 from kimono-koans/ls_fix_errno_1
ls: Fix Errno 1, print errors at the md call point
2022-01-09 20:56:06 +01:00
moko256
5659bf8fae
ls: On Windows use DirEntry#metadata() instead of fs::metadata 2022-01-10 02:56:22 +09:00
kimono-koans
4ea61545c6
Merge branch 'uutils:master' into ls_fix_errno_1 2022-01-07 21:48:53 -06:00
electricboogie
01585a57f6 Fix Errno 1, print errors at the md call point 2022-01-07 00:38:24 -06:00
electricboogie
30b2425541 Fix newline when only dirs in base directory, and test 2022-01-06 14:58:56 -06:00
kimono-koans
421330d07a
ls: Improve error handling and other improvements (#2809)
*  print error in the correct order by flushing the stdout buffer before printing an error
*  print correct GNU error codes
*  correct formatting for config.inode, and for dangling links
*  correct padding for Format::Long
*  remove colors after the -> link symbol as this doesn't match GNU
*  correct the major, minor #s for char devices, and correct padding
*  improve speed for all metadata intensive ops by not allocating metadata unless in a Sort mode
*  new tests, have struggled with how to deal with stderr, stdout ordering in a test though
*  tried to implement UIoError, but am still having issues matching the formatting of GNU


Co-authored-by: electricboogie <32370782+electricboogie@users.noreply.github.com>
2022-01-05 14:50:37 +01:00
kimono-koans
fd64e01d92
ls: Reduce binary size of ls by removing regex crate (#2781) 2021-12-22 18:31:45 +01:00
Roy Ivy III
f20aa49821 maint/CICD ~ (GHA) fix cargo-udeps false positives (add 'ignore' exceptions to sub-crates) 2021-11-19 17:55:02 -06:00
equal-l2
cda3d5a29b ls: add possible value for --color= 2021-11-06 03:42:27 +09:00
Thomas Queiroz
007f1b9f84
uu+tests: use strip_prefix and strip_suffix 2021-10-24 12:23:32 -03:00
Sylvestre Ledru
59e9870c56 Prepare version 0.0.8 2021-10-23 19:21:50 +02:00
Jeffrey Finkelstein
d013461a6f ls: replace redundant closure with function itself 2021-10-02 09:46:43 -04:00
Jan Scheer
8cd8c25b0d
ls: silence clippy warnings if feat_selinx is not set 2021-09-22 13:49:08 +02:00
Jan Scheer
8f229aad87
ls: move SELinux String building logic to its own function 2021-09-22 12:24:27 +02:00
Jan Scheer
79d838b1c3
Merge branch 'master' into ls_selinux 2021-09-17 14:14:47 +02:00
Sylvestre Ledru
7eaae75bfc add a github action job to identify unused deps 2021-09-15 12:06:50 +02:00
Jan Verbeek
1edd2bf3a8 Do not discard non-OS error messages 2021-09-14 15:11:54 +02:00
Sylvestre Ledru
826c948234 ls: remove the unused dep on locale 2021-09-13 18:15:51 +02:00
Jan Scheer
4dc6536bb9
Merge branch 'master' into ls_selinux 2021-09-13 13:42:51 +02:00
Jan Scheer
cd2153eac6
ls: (--context/-Z) add support for invalid utf8
If security context byte slice contains invalid utf8:
* issue warning
* show replacement characters for invalid utf8 sequences
2021-09-13 13:24:44 +02:00
Jan Scheer
e018a45b54
test_ls: add/adjust tests for SELinux context 2021-09-11 04:13:30 +02:00
Jan Scheer
fe3645d4d5
ls: add support for showing SELinux context (--context/-Z) 2021-09-10 21:33:34 +02:00
Michael Debertol
2170d81621
Merge pull request #2633 from blyxxyz/update-quoting
Update filename quoting and printing
2021-09-09 20:42:00 +02:00
Sylvestre Ledru
ff5607c363
Merge pull request #2622 from tertsdiepraam/ls/special-chars-in-double-quotes
`ls`: always use single quotes when `$`, `\` or ` are present in a filename
2021-09-07 22:04:48 +02:00
Jan Verbeek
259f18fcab Update message quoting and filename printing 2021-09-07 19:49:01 +02:00
Mahmoud Soltan
9bc14a239c
Added support for ls -l --color to color symlink targets as well. (#2627)
* Fixed some documentation of display_item_long that was missed in #2623

* Implemented coloring of `ls -l` symlink targets( after the arrow `->`).

* Documented display_file_name to some extent.

* Ran rustfmt as part of mitigating CI chain errors.

* Removed unused variables and code in test_ls_long_format as per #2623

specifically, as per
https://github.com/uutils/coreutils/pull/2623#pullrequestreview-742386707

* Added a thorough test for `ls -laR --color` symlink coloring implemented in this branch.

* renamed test files and dirs to shorter names and ran rustfmt.

* Changed the order with which files are expected to match the change in their name.

* Bettered some comments.

* Removed needless borrow. Fixed that one clippy warning.

* Moved the cfg not windows up to the function level

because this function is meant to only run in non-windows OS (with
groups and unames).

Fixes the unused variable warning in CI.
2021-09-05 13:25:56 +02:00
Sylvestre Ledru
499f10ca1f
Merge branch 'master' into ls/special-chars-in-double-quotes 2021-09-03 09:00:54 +02:00
Jan Verbeek
483a5fd1d4 ls: Process OsStrings instead of Strings 2021-08-31 22:07:24 +02:00
Jan Verbeek
4d6faae555 ls: Fix --{show, hide}-control-chars logic 2021-08-31 22:07:24 +02:00
Jan Verbeek
b5550bc4dd ls: Accept badly-encoded filenames 2021-08-31 22:07:24 +02:00
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 b88db6a817.

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

This reverts commit 0c690dda8d.

* 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
Terts Diepraam
67e7fdfc2e ls: use single quotes when $, \ or ` are present in a filename 2021-08-30 10:40:38 +02:00
Sylvestre Ledru
aa07f4f3d6
Merge pull request #2608 from tertsdiepraam/ls/fix-tilde-hash-quote
ls: only quote ~ and # when they appear at the start of the name
2021-08-28 09:54:23 +02:00
Terts Diepraam
d5dd4f6cff ls: only quote ~ and # when they appear at the start of the name
For example, we quote '~a' and '~' but not a~
2021-08-27 15:39:04 +02:00
Andreas Hartmann
229948ae45 uu: Replace safe_unwrap with crash_if_err
Unify the usage of macros `safe_unwrap` and `crash_if_err` that are
identical to each other except for the assumption of a default error
code. Use the more generic `crash_if_err` so that `safe_unwrap` is now
obsolete and can be removed.
2021-08-25 13:59:39 +02:00
Michael Debertol
252220e9eb refactor/uucore ~ make util_name and execution_phrase functions
Since util_name and execution_phrase no longer rely on features that are
only available to macros, they may as well be plain functions.
2021-08-14 17:55:18 +02:00
Roy Ivy III
c0854000d1 refactor ~ use execution_phrase!() for usage messaging 2021-08-14 14:01:33 +02:00
Roy Ivy III
23b68d80ba refactor ~ usage() instead of get_usage() 2021-08-14 13:58:43 +02:00
Roy Ivy III
c5792c2a0f refactor ~ use util_name!() as clap::app::App name argument for all utils 2021-08-14 13:53:13 +02:00
Sylvestre Ledru
ea5097e4a0
Merge pull request #2562 from tertsdiepraam/uucore/simpler-uerror
`uucore`: simpler `UResult` and `UError`
2021-08-13 01:33:23 +02:00
Michael Debertol
0af244ac42 ls: default to one-line output if stdout is not a tty 2021-08-11 22:03:41 +02:00
Michael Debertol
988cc49d4a ls: print a single line when width is set to 0
This means that we treat a width=0 as infinite width.
2021-08-11 19:12:45 +02:00
Michael Debertol
13a62489c5 ls: correct fallbacks for terminal width
If options::WIDTH is not given, we should try to use the terminal width.
If that is unavailable, we should fall back to the 'COLUMNS' environment variable.
If that is unavailable (or invalid), we should fall back to a default of 80.
2021-08-11 19:12:37 +02:00
Terts Diepraam
1649217116 uucore: remove distinction between common and custom errors
As custom errors are prefered over wrapping around common errors, the
distinction between UCommonError and UCustomError is removed. This
reduces the number of types and makes the error handling easier to
understand.
2021-08-10 17:55:28 +02:00
Jeremy Soller
134c1aa407
ls: do not use gid2grp on redox 2021-08-06 13:56:20 -06:00
sagu
9702aa6414
Revert "silent buggy clippy warning" 2021-07-25 18:06:41 +02:00
Sylvestre Ledru
26a882551b update the dep to uucore_procs 0.0.6 2021-07-11 21:04:11 +02:00
Sylvestre Ledru
1d8a66b7d3 Update to version 0.0.7 2021-07-11 18:04:56 +02:00
Sylvestre Ledru
f2e12fee0a Silent buggy clippy warnings
Fails with:
```
error: use of irregular braces for `write!` macro
  --> src/uucore/src/lib/features/encoding.rs:19:17
   |
19 | #[derive(Debug, Error)]
   |                 ^^^^^
   |
   = note: `-D clippy::nonstandard-macro-braces` implied by `-D warnings`
help: consider writing `Error`
  --> src/uucore/src/lib/features/encoding.rs:19:17
   |
19 | #[derive(Debug, Error)]
   |                 ^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
   = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)
```
2021-07-04 19:06:37 +02:00
Sylvestre Ledru
e4204fcf07
Merge pull request #2436 from hbina/hbina-ls-refactor-options-module
ls: Refactored options and other long constants to fix formatting
2021-07-04 11:59:06 +02:00
Terts Diepraam
5a40148602
Merge pull request #2463 from miDeb/wrap-help
all utils: enable wrap_help
2021-07-01 13:18:32 +02:00
Terts Diepraam
6213a2a967
Merge pull request #2462 from miDeb/sort/version
sort/ls: implement version cmp matching GNU spec
2021-07-01 13:02:59 +02:00
Terts Diepraam
e4eac825fb ls: adapt to standardized error handling 2021-06-28 13:49:57 +02:00
Michael Debertol
2ebca384c6 all utils: enable wrap_help
This makes clap wrap the help text according to the terminal width,
which improves readability for terminal widths < 120 chars,
because clap defaults to a width of 120 chars without this feature.
2021-06-27 16:17:10 +02:00
Michael Debertol
233a778963 sort/ls: implement version cmp matching GNU spec
This reimplements version_cmp, which is used in sort and ls to sort
according to versions.
However, it is not bug-for-bug identical with GNU's implementation.
I reported a bug with GNU here:
https://lists.gnu.org/archive/html/bug-coreutils/2021-06/msg00045.html
This implementation does not contain the bugs regarding the handling of
file extensions and null bytes.
2021-06-27 15:29:17 +02:00
Hanif Bin Ariffin
4778a64989 ls: Refactored options and other long constants to fix formatting
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>

Keep one of the texts in-place

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>

Reduced the fix to just formatting changes

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-06-27 14:55:55 +08:00
Michael Debertol
0531153fa6 uutils: move clap::App creation to separate functions 2021-06-25 21:23:45 +02:00
Sylvestre Ledru
87eaf6e80a
Merge pull request #2447 from jhscheer/locale_c
fix some issues with locale (replace "LANGUAGE" with "LC_ALL")
2021-06-23 12:36:40 +02:00
Jan Scheer
c0be979611 fix some issues with locale (replace "LANGUAGE" with "LC_ALL")
`LANGUAGE=C` is not enough, `LC_ALL=C` is needed as the environment
variable that overrides all the other localization settings.

e.g.
```bash
$ LANGUAGE=C id foobar
id: ‘foobar’: no such user

$ LC_ALL=C id foobar
id: 'foobar': no such user
```

* replace `LANGUAGE` with `LC_ALL` as environment variable in the tests
* fix the the date string of affected uutils
* replace `‘` and `’` with `'`
2021-06-23 11:30:28 +02:00
Anup Mahindre
4b3224dd82
ls: Fix clippy warning 2021-06-21 20:29:22 +05:30
Anup Mahindre
3b641afadc ls: Fix issue with Windows and dangling symbolic links
- Windows hidden file attribute determination would assume symbolic link
  to be valid and would panic
- Check symbolic link's attributes if the link points to non-existing
  file
2021-06-20 16:56:25 +05:30
Anup Mahindre
f6cb1324b6 ls: Fix problems dealing with dangling symlinks
- For dangling symlinks, errors should only be reported if
dereferencing options were passed and dereferencing was applicable to
the particular symlink
- With -i parameter, report '?' as the inode number for dangling
symlinks
2021-06-20 13:31:45 +05:30
Dean Li
c73ba1630e
ls: set show-control-char if stdout is terminal 2021-06-17 19:55:21 +08:00
Roy Ivy III
99fae850ae refactor/ls ~ fix cargo clippy complaint (clippy::needless_borrow) 2021-06-06 19:28:23 -05:00
Sylvestre Ledru
d8c06dd6bb use clap::crate_version macro instead of the env variable 2021-06-02 19:00:19 +02:00
Sylvestre Ledru
3625d98fc3
Merge pull request #2326 from tertsdiepraam/ls/hide-ignore-help-text
`ls`: add help text and value name for `--hide` and `--ignore`
2021-06-01 11:41:39 +02:00
Terts Diepraam
1dc4ab92d9 ls: add help text and value name for --hide and --ignore 2021-06-01 10:27:50 +02:00
Roy Ivy III
ceda51dd5c docs/ls ~ fix spelling + whitespace 2021-05-31 08:23:58 -05:00
Roy Ivy III
5942ba05ef refactor/ls ~ polish spelling (comments, names, and exceptions) 2021-05-31 08:11:32 -05:00
Roy Ivy III
9c0c8eb59f change ~ remove 'main.rs' spell-checker exceptions 2021-05-31 08:11:31 -05:00
Anup Mahindre
898d325aea ls: Fix minor output mismatch
When a single directory is passed to ls in recursive mode, uutils ls
won't print the directory name
======================
GNU ls:
z:
======================
======================
uutils ls:
======================

This commit fixes this minor inconsistency and adds corresponding test.
2021-05-30 18:00:52 +05:30
Jan Scheer
3aeccfd802 fix a lot of clippy warnings 2021-05-29 15:11:22 +02:00
Jan Scheer
a2947f6897 fix clippy warning 2021-05-29 00:46:25 +02:00
Anup Mahindre
414c92eed7 ls: Fix printing paths behavior
For any commandline arguments, ls should print the argument as is (and
not truncate to just the file name)
For any other files it reaches (say through recursive exploration), ls
should print just the filename (as path is printed once when we enter
the directory)
2021-05-21 22:22:28 +05:30
Jan Scheer
4ac75898c3 fix clippy warnings 2021-05-10 15:48:32 +02:00
Terts Diepraam
f6e5f86fe7 Merge branch 'master' into ls/device_information 2021-05-08 23:21:44 +02:00
Jan Scheer
a885376583 uucore: refactor - reduce duplicate code related to fs::display_permissions
This is a refactor to reduce duplicate code, it affects chmod/ls/stat.
* merge `stat/src/fsext::pretty_access` into `uucore/src/lib/feature/fs::display_permissions_unix`
* move tests for `fs::display_permissions` from `test_stat::test_access` to `uucore/src/lib/features/fs::test_display_permissions`
* adjust `uu_chmod`, `uu_ls` and `uu_stat` to use `uucore::fs::display_permissions`
2021-05-08 11:52:41 +02:00
Terts Diepraam
3b6c7bc9e9 Fix mistakes with merging 2021-05-08 00:50:36 +02:00
Terts Diepraam
6834d0256e Merge branch 'master' into ls/device_information 2021-05-07 18:56:44 +02:00
Anup Mahindre
7d2b051866
Implement Total size feature (#2170)
* ls: Implement total size feature

- Implement total size reporting that was missing
- Fix minor formatting / readability nits

* tests: Add tests for ls total sizes feature

* ls: Fix MSRV build errors due to unsupported attributes for if blocks

* ls: Add windows support for total sizes feature

- Add windows support (defaults to file size as block sizes related
infromation is not avialable on windows)
- Renamed some functions
2021-05-05 23:03:25 +02:00
Sylvestre Ledru
f8ec4a554c
Merge pull request #2161 from tertsdiepraam/ls/sort_order_and_subdirectory_listing
`ls`: C sort order and fix subdirectory listing
2021-05-02 17:21:56 +02:00
Terts Diepraam
eb3206737b ls: give '.' a file_type 2021-05-02 10:20:14 +02:00
Terts Diepraam
361408cbe5 ls: remove case-insensitivity and leading period of name sort 2021-05-02 10:04:11 +02:00
Terts Diepraam
28c7800f73 ls: fix subdirectory name 2021-05-02 10:03:01 +02:00
Sylvestre Ledru
5e82b195bd ls: remove redundant import 2021-05-02 09:35:00 +02:00
Terts Diepraam
d300895d28 ls: add birth time for windows and attampt to fix test 2021-04-29 22:23:04 +02:00
Terts Diepraam
d624827913 ls: fix windows and add more file types 2021-04-29 18:44:46 +02:00
Terts Diepraam
c69afa00ff ls: implement device symbol and id 2021-04-29 18:25:34 +02:00
Rein F
a60fd07bc3
ls: improvements on time handling (#1986)
* ls: added creation time

* ls: Added most time features

Missing support for posix-,Format+, translating via locales. Also required more tests

* ls: rustfmt

* ls: Additional changes and fixes

Fixed the argument order, fixed a wrong iso format.

* ls: additional tests for styles

* ls: perfected arg parsing on time styles

* fix birthime test

* ls: Use 'stdout_str' in new tests

* ls: Disabled birthtime test for windows

* ls: removed indoc as a dependency

* ls: birthime test, sync first created file

* ls: birthime test, add comment explaining sync

* Removed ruby testfile birth_test.rb

This accidentally got commited in a merge
2021-04-28 20:54:27 +02:00
Sylvestre Ledru
7a3b44d972
Merge pull request #2133 from tertsdiepraam/ls/fix_color_grid_alignment
`ls`: fix grid alignment with `--color`
2021-04-26 22:51:21 +02:00
Sylvestre Ledru
ece5e14b0d
fix a typo 2021-04-26 22:51:02 +02:00
Terts Diepraam
35838dc8a9 ls: document hyperfine script 2021-04-26 18:36:15 +02:00
Terts Diepraam
4023e40174 ls: further reduce OsStr -> String conversions 2021-04-26 18:03:56 +02:00
Terts Diepraam
c69b72c840 ls: forgot to commit Cargo.{toml, lock} 2021-04-26 15:04:55 +02:00
Terts Diepraam
58fd61b3e8 ls: fix grid alignment for unicode 2021-04-26 15:00:39 +02:00
Terts Diepraam
cfc11b47a5 ls: fix grid alignment with --color 2021-04-26 14:41:41 +02:00
Terts Diepraam
e4c0069493 ls: remove path strip 2021-04-26 09:53:13 +02:00
Terts Diepraam
322478d9a2 ls: document flamegraph 2021-04-26 09:37:47 +02:00
Sylvestre Ledru
7dcc8c2960
Merge pull request #1968 from alstolten/feat2
ls: Implements extension sorting
2021-04-26 09:03:06 +02:00
Christopher Regali
368e984fac
Change unchecked unwrapping to unwrap_or_default for Args-trait (#1845) (#1852)
* Change unchecked unwrapping to unwrap_or_default for argument parsing (resolving #1845)

* Added unit-testing for the collect_str function on invalid utf8 OsStrs

* Added a warning-message for identification purpose to the collect_str method.

* - Add removal of wrongly encoded empty strings to basename
- Add testing of broken encoding to basename
- Changed UCommand to use collect_str in args method to allow for integration testing of that method
- Change UCommand to use unwarp_or_default in arg method to match the behaviour of collect_str

* Trying out a new pattern for convert_str for getting a feeling of how the API feels with more control

* Adding convenience API for compact calls

* Add new API to everywhere, fix test for basename

* Added unit-testing for the conversion options

* Added unit-testing for the conversion options for windows

* fixed compilation and some merge hiccups

* Remove windows tests in order to make merge request build

* Fix formatting to match rustfmt for the merged file

* Improve documentation of the collect_str method and the unit-tests

* Fix compilation problems with test

Co-authored-by: Christopher Regali <chris.vdop@gmail.com>
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2021-04-25 23:28:42 +02:00
Ricardo Iglesias
c3d7358df6
ls: ignore leading period when sorting by name (#2112)
* ls: ignore leading period when sorting by name

ls now behaves like GNU ls with respect to sorting files by ignoring
leading periods when sorting by main.

Added tests to ensure "touch a .a b .b ; ls" returns ".a  a  .b  b"

* Replaced clone/collect calls.
2021-04-25 21:08:05 +02:00
Alessandro Stoltenberg
43f3f7e01c feat2: Rebased on current master and incorporated changes done to the filetype handling. 2021-04-25 20:13:42 +02:00
Alessandro Stoltenberg
9c221148a8 ls: Extension sorting, use file_stem() instead of to_string_lossy() 2021-04-25 19:45:59 +02:00
Alessandro Stoltenberg
bbcca3eefd ls: Implements https://github.com/uutils/coreutils/issues/1880 extension sorting. 2021-04-25 19:45:59 +02:00
Sylvestre Ledru
e667cc2641
Merge pull request #2115 from tertsdiepraam/ls/reduce_write_calls
`ls`: reduce write syscalls & cleanup
2021-04-25 11:52:51 +02:00
Terts Diepraam
fc6c7a279e ls: clean up imports 2021-04-25 10:46:51 +02:00
Anup Mahindre
7e06316ece ls: Use sort_by_cached_key 2021-04-25 13:37:07 +05:30
Terts Diepraam
e995eea579 ls: general cleanup 2021-04-25 00:23:14 +02:00
Terts Diepraam
ce04f8a759 ls: use bufwriter to write stdout 2021-04-24 23:46:19 +02:00
Terts Diepraam
1328d18878 ls: remove outdated comment 2021-04-24 13:19:50 +02:00
Terts Diepraam
728f0bd61d ls: remove redundant parentheses 2021-04-24 10:47:36 +02:00
Terts Diepraam
ce8c58b93e Merge branch 'master' into ls/skip_metadata 2021-04-24 10:45:43 +02:00
Sylvestre Ledru
fb6394554e
Merge pull request #2096 from tertsdiepraam/ls/fix_backslash_escape
ls: improve code cov
2021-04-24 10:05:32 +02:00
Terts Diepraam
eccb86c9ed ls: fix -a test 2021-04-23 08:26:20 +02:00
Terts Diepraam
3874a24457 ls: add once_cell to Cargo.toml 2021-04-23 00:35:45 +02:00
Terts Diepraam
a114f855f0 ls: revert to_ascii_lowercase 2021-04-22 23:43:00 +02:00
Terts Diepraam
e241f3ad69 ls: skip reading metadata 2021-04-22 22:45:24 +02:00
Terts Diepraam
ea10647a62 Merge remote-tracking branch 'upstream/master' into ls/fix_backslash_escape 2021-04-22 14:23:35 +02:00
Terts Diepraam
b9f4964a96 ls: bring up to date with recent changes 2021-04-22 11:39:08 +02:00
Terts Diepraam
cd1514bd57 Merge branch 'master' into ls/cross_platform_colors 2021-04-22 11:30:26 +02:00
Terts Diepraam
4e4c3aba00 ls: don't color symlink target 2021-04-22 11:16:33 +02:00
Anup Mahindre
8554cdf35b
Optimize recursive ls (#2083)
* ls: Remove allocations by eliminating collect/clones

* ls: Introduce PathData structure

- PathData will hold Path related metadata / strings that are required
frequently in subsequent functions
- All data is precomputed and cached and subsequent functions just
use cached data

* ls: Cache more data related to paths

- Cache filename and sort by filename instead of full path
- Cache uid->usr and gid->grp mappings
https://github.com/uutils/coreutils/pull/2099/files
* ls: Add BENCHMARKING.md

* ls: Document PathData structure

* tests/ls: Add testcase for error paths with width option

* ls: Fix unused import warning

cached will be only used for unix currently as current use of
caching gid/uid mappings is only relevant on unix

* ls: Suggest checking syscall count in BENCHMARKING.md

* ls: Remove mentions of sort in BENCHMARKING.md

* ls: Remove dependency on cached

Implement caching using HashMap and lazy_static

* ls: Fix MSRV error related to map_or

Rust 1.40 did not support map_or for result types
2021-04-22 09:19:17 +02:00
Terts Diepraam
1d7e206d72 ls: fix mac build 2021-04-21 20:04:52 +02:00
Terts Diepraam
3fc8d2e422 ls: make compatible with Rust 1.40 again 2021-04-21 18:05:10 +02:00
Terts Diepraam
ff39538375 ls: further refactor --color and classification 2021-04-21 18:00:43 +02:00
Terts Diepraam
34a824af71 ls: use lscolors crate 2021-04-21 17:35:02 +02:00
Terts Diepraam
29b5b6b276 ls: fix unit tests to match last change 2021-04-21 13:03:31 +02:00
Terts Diepraam
f34c992932 ls: always quote backslash in shell style 2021-04-21 12:45:21 +02:00
Terts Diepraam
fd54614130 Merge branch 'master' into ls/fix_backslash_escape 2021-04-21 12:06:54 +02:00
Terts Diepraam
f84f23ddfe tests/ls: add coverage for special shell character after escaped char 2021-04-21 11:22:10 +02:00
Terts Diepraam
795d89f11d ls: don't escape backslash in shell style quoting 2021-04-21 11:08:40 +02:00
Sylvestre Ledru
eec389fa94
Merge branch 'master' into ls/dereference-command-line 2021-04-17 10:30:42 +02:00
Terts Diepraam
2c130ae7c0 ls: take -l into account with dereference-command-line 2021-04-14 14:42:14 +02:00
Terts Diepraam
5c28ac1b0d ls: dereference command line 2021-04-14 14:12:00 +02:00
Reto Hablützel
d67560c37a fix clippy for unix 2021-04-11 16:34:19 +02:00
Reto Hablützel
b465c34eef fix ls 2021-04-11 16:16:38 +02:00
Reto Hablützel
97d12d6e3c fix trivial warnings without features 2021-04-11 16:05:25 +02:00
Sylvestre Ledru
cc4f32d87a
Merge pull request #2035 from tertsdiepraam/ls/hide_and_ignore
ls: add short option for ignore
2021-04-06 08:54:26 +02:00
Terts Diepraam
cbc5132981 ls: add short option for ignore 2021-04-05 23:06:56 +02:00
Sylvestre Ledru
7cdeb18dff
Merge pull request #2026 from tertsdiepraam/ls/hide_and_ignore
ls: --hide and --ignore
2021-04-05 22:31:23 +02:00
Terts Diepraam
5134348a11 ls: use globset instead of glob 2021-04-04 23:39:11 +02:00
Terts Diepraam
51770e6bee ls: invalid pattern move from error to warning 2021-04-04 22:40:36 +02:00
Terts Diepraam
76308dbec9 ls: tests for invalid patterns for hide and ignore 2021-04-04 22:35:22 +02:00
Terts Diepraam
fa4272a19b ls: --hide and --ignore 2021-04-04 19:19:56 +02:00
Sylvestre Ledru
bd8b129d9a
Merge pull request #2016 from tertsdiepraam/ls/control_characters
ls: show/hide control chars
2021-04-04 18:38:15 +02:00
Sylvestre Ledru
f37284129e new release 0.0.6 to address the cat issue 2021-04-03 16:06:58 +02:00
Terts Diepraam
06bdc144d7 ls: show/hide control chars 2021-04-03 12:43:37 +02:00