Commit graph

72 commits

Author SHA1 Message Date
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
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
Sylvestre Ledru
ac031dffa4 new release 0.0.5 2021-04-03 10:30:07 +02:00
Sylvestre Ledru
dcbcf01665 Fix some clippy warnings 2021-04-01 23:42:30 +02:00
Terts Diepraam
2941dfd698
ls: quoting style (#1989) 2021-04-01 22:50:13 +02:00
Ricardo Iglesias
5f17719a59
Implemented --indicator-style flag on ls. (#1907)
* Implemented --indicator-style flag on ls.

* Rust fmt

* Grouped indicator_style args.

* Added tests for sockets and pipes.

Needed to modify util.rs to add support for pipes (aka FIFOs).

* Updated util.rs to remove FIFO operations on Windows

* Fixed slight error in specifying (not(windows))

* Fixed style violations and added indicator_style test for non-unix systems
2021-03-29 13:10:13 +02:00
Terts Diepraam
955c547adf
ls: overrideable -n option (#1917) 2021-03-26 19:12:01 +01:00
Terts Diepraam
23b70001a8
ls: version sort (#1898) 2021-03-25 20:24:53 +01:00
Terts Diepraam
de3f9b8186
ls: across & commas formats and width parameter (#1869) 2021-03-22 18:24:23 +01:00
Terts Diepraam
25d4a08387
ls: long format author, group and owner (#1850)
This PR adds the options to customize what information is shown in long format regarding author, group & owner. Specifically it adds:
- `--author`: shows the author, which is always the same as the owner. GNU has this feature because GNU/Hurd supports a difference between author and owner, but I don't think Rust supports GNU/Hurd, so I just used the owner.
- `-G` & `--no-group`: hide the group information.
- `-o`: hide the group and use long format (equivalent to `-lG`).
- `-g`: hide the owner and use long format.

The `-o` and `-g` options have some interesting behaviour that I had to account for. Some examples:
- `-og` hides both group and owner.
- `-ol` still hides the group. Same behaviour with variations such as `-o --format=long`, `-gl`, `-g --format=long` and `-ogl`.
- They even retain some information when overridden by another format: `-oCl` (or `-o --format=vertical --format=long`) still hides the group.

My previous solution for handling the behaviour where `-l1` shows the long format did not fit with these additions, so I had to rewrite that as well.

The tests only cover the how many names (author, group and owner) are present in the output, so it can't distinguish between, for example, author & group and group & owner.
2021-03-21 16:18:06 +01:00
Sylvestre Ledru
e76ce1e908
Merge pull request #1844 from tertsdiepraam/ls/si
ls: --si flag and more compatible size formatting
2021-03-19 21:18:25 +01:00
Terts Diepraam
118b802fe8 ls: --si and more compatible size formatting 2021-03-19 15:14:25 +01:00
Sylvestre Ledru
976fa95ce8 fix(ls): fix a clippy warning
"this `if` has identical blocks"
2021-03-19 14:25:07 +01:00
Terts Diepraam
10135dccef ls: fix unused import and improve coverage 2021-03-15 13:46:21 +01:00
Terts Diepraam
20094127c3 ls: --color back on windows as noop 2021-03-15 12:21:08 +01:00
Terts Diepraam
f28d5f4a73 ls: attempt to fix windows sorting issues 2021-03-15 12:07:10 +01:00
Terts Diepraam
a4c79c92ae ls: fix windows issues 2021-03-15 10:24:24 +01:00
Terts Diepraam
01fd207c81 ls: remove list of missing features 2021-03-15 09:53:19 +01:00
Terts Diepraam
5656a717c9 ls: make name sort case insensitive 2021-03-15 09:31:13 +01:00
Terts Diepraam
61a95239ce ls: rename display to format, set arg overrides 2021-03-15 09:30:50 +01:00
Terts Diepraam
7bde2e78a9 ls: simplify --color and remove it on windows 2021-03-14 23:34:52 +01:00
Terts Diepraam
c86c18cbb5 ls: implement -c and -u 2021-03-14 23:11:11 +01:00
Terts Diepraam
c454d2640c ls: structure options some more 2021-03-14 21:32:21 +01:00
Terts Diepraam
5d7a851471 ls: fix --color behaviour 2021-03-14 21:30:21 +01:00
Terts Diepraam
0717a5f301 ls: formatting 2021-03-14 13:32:15 +01:00
Terts Diepraam
7c8e8b2d4c ls: refactor arguments into a config struct 2021-03-14 12:22:32 +01:00
Terts Diepraam
9e98d24f5f ls: move from getopts to clap 2021-03-13 23:43:36 +01:00
Sylvestre Ledru
6ad8528b99 update of the uucore dep to 0.0.7 2021-03-07 11:29:38 +01:00
Sylvestre Ledru
6481c5a247 Prepare version 0.0.4 2021-03-07 11:29:38 +01:00
Sylvestre Ledru
bd6b958655 Moved to atty 2021-02-12 11:37:32 +01:00
Kevin Burke
26aa1f346e ls: only print colors if stdout is a tty
Previously if no --color argument was input, we would always print
colors in the output. This breaks `configure` scripts which run `ls`
and then compare the output against what they expect to see, since the
left side has ANSI escape sequences and the right side doesn't.

Instead, only print escape sequences if a TTY is present, or if
`--color=always` is specified.

Fixes #1638.
2021-02-12 11:37:32 +01:00
Sylvestre Ledru
262b508b89 update the dep to uucore 0.0.6 2021-02-01 23:55:43 +01:00