Commit graph

302 commits

Author SHA1 Message Date
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
Sylvestre Ledru
a807fc623a Update to version 0.0.3 2021-01-22 09:40:38 +01:00
Sylvestre Ledru
b8e886ad1a bump the minimal version of uucore & uucore_procs 2021-01-10 18:27:20 +01:00
Sylvestre Ledru
d9ae043a05
update of the version 0.0.1 => 0.0.2 (#1686) 2021-01-10 18:16:04 +01:00
Sylvestre Ledru
d9580c2f3a
ls: move from isatty (deprecated) to atty (#1685) 2021-01-09 21:21:02 +01:00
Sylvestre Ledru
7942a64231 Remove 'extern crate'
Not necessary anymore. See:
https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html#no-more-extern-crate
2020-12-31 15:44:00 +01:00
Sylvestre Ledru
36d903e611
number-prefix: Move from 0.2 to 0.4 (#1670) 2020-12-22 13:53:20 +01:00
Diego Magdaleno
8b12686888
ls: On Windows don't display files hidden by NTFS (#1662)
This little check, allows us to hide the files that
shouldn't be shown on the listing on Windows operating
systems.

Just like the "dot" in UNIX based operating systems
Windows uses its own file attributes to determine if a file
is hidden or not.

The lack of support for this option is normally an annoyance
for many users, this commit adds full support for this feature
2020-12-19 17:54:28 +01:00
Sylvestre Ledru
ba126afe54 fix(ls): follow the display of GNU ls 2020-12-13 12:12:19 +01:00
Sylvestre Ledru
8a1628cf89 fix(ls): When a file doesn't exist, exit early and fails ls
Currently, running
$ ls doesntexist
will return 0
while it should return 1

Ditto for
$ ls doesntexist a
2020-12-13 12:12:19 +01:00
Roy Ivy III
6539b8c6b9 maint/deps ~ change version specification for dependencies between sub-packages
- refactor internal version specifications to be ">=M.m.p" (where M.m.p is *already published*)

## [why]

Loosening internal version dependencies decreases the coupling between packages such
that packages can be published in a looser order. It allows the packages to be version
updated and published in tandem (ie, by using `cargo workspace ...`). Once published,
the internal versions can then be updated (again, to an *already published* package
version), as needed.
2020-11-08 20:26:46 -06:00
Roy Ivy III
c17307c757 fix ~ update workspace pointers to 'uucore' and 'uucore_procs' 2020-11-08 20:26:46 -06:00
16yuki0702
19e967ef31
ls: deleting user defined max function (#1591)
This is trivial refactor.
```usize``` can call max method, so deleting user defined max function.
2020-08-26 09:42:27 +02:00
Alex Lyon
110d6844ad
Use an iterator over OsString for uumain()
Additionally, restructure `uname` so that we don't need to find the
iterator's length.
2020-06-16 03:28:02 -05:00
Roy Ivy III
fbbd881ca9 docs ~ reduce sub-crate meta-information keywords to the maximum of five 2020-05-31 15:48:54 -05:00
Roy Ivy III
f82de13847 docs ~ spell-check repairs and addition of exceptions 2020-05-30 01:36:02 -05:00
Roy Ivy III
ea3235c7e2 change ~ new_coreopts!() => app!() (from uucore v0.0.4) 2020-05-29 22:59:48 -05:00
Roy Ivy III
6f465eeb9f deps ~ update utils to uucore/uucore_procs v0.0.4 2020-05-29 22:59:48 -05:00
Roy Ivy III
d70db1f7d2 docs ~ improve/update sub-crate meta information 2020-05-29 22:59:47 -05:00
Roy Ivy III
db2e950918 change ~ make all sub-crates independent 2020-05-29 22:59:40 -05:00
Roy Ivy III
5aa2b039a5 change ~ fixup paths (within workspace packages) to common code 2020-04-14 13:46:19 -05:00
Roy Ivy III
78c362c8b5 change ~ fixup paths (within workspace packages) 2020-04-14 13:46:18 -05:00
Roy Ivy III
f0b0e3b867 change ~ reorganize code files 2020-04-14 13:46:18 -05:00