Commit graph

976 commits

Author SHA1 Message Date
Jan Scheer
be8650278b Merge branch 'master' into refactoring_parse_size 2021-06-09 13:44:40 +02:00
Sylvestre Ledru
4471335609
Merge pull request #2360 from rivy/fix+rf
build and *lots* of clippy fixes
2021-06-08 22:06:11 +02:00
Jan Scheer
26ad05cbb4 uucore: fix order of group IDs returned from entries::get_groups()
As discussed here: https://github.com/uutils/coreutils/pull/2361
the group IDs returned for GNU's 'group' and GNU's 'id --groups'
starts with the effective group ID.
This implements a wrapper for `entris::get_groups()` which mimics
GNU's behaviour.

* add tests for `id`
* add tests for `groups`
* fix `id --groups --real` to no longer ignore `--real`
2021-06-08 18:39:05 +02:00
Roy Ivy III
1faa9eebab refactor/polish ~ cargo make format 2021-06-06 19:28:25 -05:00
Roy Ivy III
9feff1e441 tests ~ fix cargo clippy complaint (*allow* clippy::needless_borrow; for *false positives*) 2021-06-06 19:28:25 -05:00
Roy Ivy III
7df5acc2dc tests ~ fix cargo clippy complaint (*allow* clippy::manual_strip; with FixME/ToDO)
- replace with the included/noted code when MSRV includes a stabilized `String::strip_prefix()`
2021-06-06 19:28:25 -05:00
Roy Ivy III
26cb6540da tests ~ fix cargo clippy complaint (clippy::useless_format) 2021-06-06 19:28:25 -05:00
Roy Ivy III
0dc8c18bac tests ~ fix cargo clippy complaint (clippy::needless_borrow) 2021-06-06 19:28:25 -05:00
Roy Ivy III
5553416b87 tests ~ fix clippy complaint (clippy::bool_assert_comparision) 2021-06-06 19:17:18 -05:00
Jan Scheer
0033928128 sort: fix broken tests for '--batch-size' (replace 'B' with 'b')
https://github.com/uutils/coreutils/pull/2297#issuecomment-855460881
2021-06-06 22:56:11 +02:00
Jan Scheer
12de58aec0 Merge branch 'master' of github.com:uutils/coreutils into refactoring_parse_size 2021-06-06 22:54:02 +02:00
Michael Debertol
7c9da82b39 sort: implement --batch-size 2021-06-06 18:01:08 +02:00
Michael Debertol
8d213219c7 sort: implement --compress-program 2021-06-06 18:01:08 +02:00
Michael Debertol
5a5c7c5a34 sort: properly check for empty reads 2021-06-06 18:01:08 +02:00
Michael Debertol
66359a0f56 sort: insert line separators after non-empty files
If files don't end witht a line separator we have to insert one,
otherwise the last line will be combined with the first line of the next
file.
2021-06-06 18:01:08 +02:00
Jan Scheer
81e07a6a4d od: replace 'piped_stdin' to make test stable 2021-06-04 17:22:45 +02:00
Jan Scheer
f8e96150f8 fix clippy warnings and spelling
* add some missing LICENSE headers
2021-06-04 15:39:34 +02:00
Jan Scheer
130bf49e5d Merge branch 'master' of github.com:uutils/coreutils into refactoring_parse_size 2021-06-03 22:32:34 +02:00
Jan Scheer
db3ee61742 du/sort/od/stdbuf: make error handling of SIZE/BYTES/MODE arguments more consistent
* od: add stderr info for not yet implemented '--strings' flag
2021-06-03 21:00:03 +02:00
Jan Scheer
ad26b7a042 head/tail/split: make error handling of NUM/SIZE arguments more
consistent

* add tests for each flag that takes NUM/SIZE arguments
* fix bug in tail where 'quiet' and 'verbose' flags did not override each other POSIX style
2021-06-03 20:37:29 +02:00
Sylvestre Ledru
841b689477
Merge pull request #2334 from sylvestre/crate_version
use crate_version!() instead of reading the env + rustfmt
2021-06-03 10:56:57 +02:00
Sylvestre Ledru
24032498ad
Merge pull request #2339 from sylvestre/gnu-compat
Improve the gnu compat and use it for "touch"
2021-06-03 10:53:47 +02:00
Sylvestre Ledru
963a0da0b4
Merge pull request #2288 from syukronrm/du-time
du: fix `--time` behavior
2021-06-03 07:56:41 +02:00
Sylvestre Ledru
5de623cfab
Merge pull request #2330 from miDeb/cp/close-fd
cp: close file descriptors after cow on linux
2021-06-03 07:54:34 +02:00
Syukron Rifail M
05aeaf3061 du: fix --time behavior 2021-06-03 08:18:23 +07:00
Sylvestre Ledru
31875a241f touch/gnu compat: 'touch no-file' exit code should be 1 2021-06-02 23:50:35 +02:00
Sylvestre Ledru
eb2c06c37e touch/gnu compat: when touch fails because of a permission error, change the error message
+ return 1 as error code when having this error
2021-06-02 23:48:16 +02:00
Jan Scheer
5898b99627 truncate: add error handling for SIZE argument
* add tests for SIZE argument
* fix clap argument handling for --size and --reference
2021-06-02 22:08:42 +02:00
Jan Scheer
2f5f7c6fa1 split: use "parse_size" from uucore
* make stderr of parsing SIZE/NUMBER argument consistent with GNU's behavior
* add error handling
* add tests
2021-06-02 21:32:41 +02:00
Michael Debertol
7ffc7d073c cp: test that file descriptors are closed 2021-06-02 19:21:16 +02:00
Michael Debertol
e5c4681e04 tests: add the ability to set resource limits 2021-06-02 19:21:12 +02:00
Sylvestre Ledru
6aa53ead7c rustfmt the recent change 2021-06-02 18:43:35 +02:00
Terts Diepraam
48516cc06a pr: fix usage of current time 2021-06-02 17:18:07 +02:00
Sylvestre Ledru
132ddf98b6
Merge pull request #2328 from miDeb/seq/validator
seq: reject NaN arguments
2021-06-02 11:20:13 +02:00
Jan Scheer
6b8de1dd8b sort: use "parse_size" from uucore
* make parsing of SIZE argument consistent with GNU's behavior
* add error handling
* add tests
2021-06-02 05:13:57 +02:00
Michael Debertol
fc2b61eb96 tests: typo 2021-06-01 23:06:51 +02:00
Michael Debertol
a323e9cda1 cp: show errors in cow on linux 2021-06-01 23:06:38 +02:00
Michael Debertol
5329d77cc2 seq: adapt output to GNU seq 2021-06-01 20:35:18 +02:00
Michael Debertol
9b29ac98a5 seq: reject NaN arguments
Move the validation logic to an argument validator.
2021-06-01 18:30:18 +02:00
Michael Debertol
06b3092f5f sort: fix debug output for zeros / invalid numbers
We were reporting "no match" when sorting something like "0 ". This is
because we don't distinguish between 0 and invalid lines when sorting.
For debug output we have to get this information back.
2021-06-01 18:18:51 +02:00
Jan Scheer
cc659c8572 Merge branch 'master' of github.com:uutils/coreutils into refactoring_parse_size 2021-06-01 12:35:48 +02:00
Jan Scheer
3c7175f00d head/tail: add fixes and tests for bytes/lines NUM arg (undocumented sign)
* change tail bytes/lines clap parsing to fix posix override behavior
* change tail bytes/lines NUM parsing logic to be consistent with head
2021-06-01 12:17:11 +02:00
Jan Scheer
84f2bff778 head: use "parse_size" from uucore 2021-06-01 09:30:43 +02:00
Sylvestre Ledru
a017c1b589
Merge pull request #2323 from miDeb/maint/spellcheck-all
maint: actually run spellcheck on all files
2021-05-31 23:36:56 +02:00
Sylvestre Ledru
8618771f2e
Merge pull request #2322 from miDeb/seq/improvements
seq: improve compatibility
2021-05-31 23:09:13 +02:00
Michael Debertol
41878f1bf4 refactor/pr: polish spelling 2021-05-31 22:46:01 +02:00
Sylvestre Ledru
7b7185f916 Fix clippy warnings in the pr tests 2021-05-31 21:20:55 +02:00
Michael Debertol
4cf18e96f3 seq: change default value for -t and remove dubious escape sequences
GNU seq does not support -t, but always outputs a newline at the end.
Therefore, our default for -t should be \n.

Also removes support for escape sequences (interpreting a literal "\n"
as a newline). This is not what GNU seq is doing, and unexpected.
2021-05-31 21:20:19 +02:00
Michael Debertol
6ccc305513 seq: implement integer sequences
If we notice that we can represent all arguments as BigInts, take a
different code path. Just like GNU seq this means we can print an
infinite amount of numbers in this case.
2021-05-31 21:20:12 +02:00
Sylvestre Ledru
badf7aacb7
Merge pull request #2300 from tertsdiepraam/pr
Implement `pr` (resurrection of the resurrected PR)
2021-05-31 21:14:57 +02:00