Commit graph

2789 commits

Author SHA1 Message Date
Sylvestre Ledru
64027e5a57
Merge pull request #6252 from sylvestre/hash-error
hashsum: improve the error management to match GNU
2024-04-21 09:55:16 +02:00
sreehari prasad
a1717436a4
cp: gnu "same-file" test case compatibility (#6190)
* cp: -b doesn't ignore "version control" env

* cp: gnu "same-file" test compatibility fix
2024-04-21 09:49:45 +02:00
Sylvestre Ledru
6ef08d7f1c hashsum: improve the error management to match GNU
Should make tests/cksum/md5sum.pl and tests/cksum/sha1sum.pl pass
2024-04-21 09:08:27 +02:00
Sylvestre Ledru
94f5e82dbd hashsum: ignore empty lines in --check 2024-04-21 09:08:27 +02:00
Daniel Hofstetter
c83cec7c0c env: move unit tests to env.rs 2024-04-21 01:26:50 +02:00
Daniel Hofstetter
29e5d0b42b clippy: fix redundant_clone lint warnings in tests 2024-04-21 01:26:50 +02:00
Sylvestre Ledru
4e1dbcd3fc
Merge pull request #6230 from sylvestre/hash-ignore-missing
hashsum: implement the ignore-missing option
2024-04-17 23:43:38 +02:00
binlingyu
9d1d4cc5f6 Fix warning when executing Clippy 2024-04-17 11:14:03 +08:00
Sylvestre Ledru
f817018f90 hashsum: --ignore-missing needs -c 2024-04-15 22:19:44 +02:00
Haisham
b617876372 kill: ignore signal case on -s 2024-04-15 03:27:51 +02:00
Haisham
524be6e4ae kill: accept all casings for signal names in --list 2024-04-15 03:27:51 +02:00
Sylvestre Ledru
b977d61f67 hashsum: implement the ignore-missing option
Tested by gnu/tests/cksum/md5sum.pl
2024-04-14 20:05:39 +02:00
Ben Wiederhake
3854569856 tee: ensure that -h and --help are identical 2024-04-14 15:42:13 +02:00
Ben Wiederhake
9527341714 pr: return correct exit code on error 2024-04-14 15:42:13 +02:00
Ben Wiederhake
f5f8cf08e0 hostid: return correct exit code on error 2024-04-14 15:42:13 +02:00
Ben Wiederhake
91679fc747 wc: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:47 +02:00
Ben Wiederhake
a699bfd1fb uniq: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
3285f95eb3 touch: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
25245bde65 tee: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
88a2ea4f3b tail: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
872ec050e4 sort: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
70d84e168c shred: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
1dd7d8e0db od: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
2646944bee numfmt: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
3877d14504 ls: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
27a81f3d32 du: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
d4546ced26 cp: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Haisham
333e4d9fe9
kill: print --table as vertical (#6216)
* kill: print --table as vertical

* kill: remove signal padding on --table

* kill: skip exit signal in --table

* kill: replace "skip" with "filter"

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-04-14 15:08:51 +02:00
Jadi
9b4a787be7
kill: return 1 and gnu style stderr in case of no pid (#6225)
* kill: return 1 and gnu style stderr in case of no pid

closes #6221

* Update src/uu/kill/src/kill.rs

Co-authored-by: Ben Wiederhake <BenWiederhake.GitHub@gmx.de>

---------

Co-authored-by: Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
2024-04-14 14:13:15 +02:00
Daniel Hofstetter
aaaf4c3f91 kill: don't show EXIT with --list 2024-04-14 13:42:55 +02:00
Haisham
d56c7bbaee kill: add test for vertical --list 2024-04-12 06:21:48 +02:00
Haisham
c4c81291b7 kill: add tests to check multiple output 2024-04-12 06:21:48 +02:00
Daniel Hofstetter
5bf939aec6
Merge pull request #6207 from BenWiederhake/pr/6069
cp: handle update prompt with and without interactive mode enabled
2024-04-11 14:55:26 +02:00
Vikrant2691
9b9c0cc237 cp: handle update prompt with and without interactive mode enabled 2024-04-09 15:14:33 +02:00
Ben Wiederhake
0375bc98a6 dd: fix flaky test_null_stats
If the first four decimal digits are zero, GNU dd elides them altogether.
Therefore, this test just contained an overly-strict regex.

See also ede944e1f8.
2024-04-07 22:45:35 +02:00
Ben Wiederhake
d5e7f9a4a4 wc: count ASCII control characters as word characters 2024-04-07 02:12:22 +02:00
Ulrich Hornung
eca8130a4a feature: env argv0 overwrite (unix only) 2024-04-07 01:27:30 +02:00
Jadi
5d17bf7d78 head: two new tests. Improves function coverage from 38 to 75 2024-04-06 05:40:26 +02:00
Jadi
1137d9a62d cut: two new tests; -d conflict & no arg 2024-04-04 21:33:22 +03:30
Jadi
4312f3c43e cksum: adding -b as the short form for --base64
closes #5706
2024-04-04 15:09:17 +03:30
Ben Wiederhake
714b4ff589 ls: fix exit code for --time-style when used 2024-04-01 22:57:18 +02:00
Ben Wiederhake
4a1bd78f48 ls: compute correct exit code on error
Note in particular that this seems to be the only tool where invalid
stringly-enum values cause a different exit code than invalid arguments.
2024-04-01 22:57:18 +02:00
Carbrex
49c7e65f5d Use time-style only if time is provided 2024-04-01 17:09:59 +02:00
Sylvestre Ledru
4482a6248f
Merge pull request #6157 from BenWiederhake/dev-tee-fail-open
tee: Correctly handle read-only files, avoid unnecessary wrapping
2024-04-01 01:41:40 +02:00
Paolo Barbolini
9e040a3df1 chore(deps): drop conv dev-dependency 2024-03-31 22:51:24 +02:00
Michael Vogt
af0ba86657 date: support -f - to read from stdin
So far `date -f -` was not reading from stdin. This commit fixes
this.

Closes: #6058
2024-03-31 22:05:47 +02:00
Ben Wiederhake
8ab825c49f tee: correctly handle writing to read-only files 2024-03-31 18:47:32 +02:00
Sylvestre Ledru
b869c67d6a
Merge pull request #6150 from BenWiederhake/dev-dircolors-repeated
dircolors: accept repeated flags
2024-03-31 12:08:55 +02:00
Ben Wiederhake
8e794d0654 dircolors: accept repeated flags 2024-03-30 22:50:57 +01:00
Ben Wiederhake
9dbf2c362d dirname: accept repeated flag 2024-03-30 22:50:52 +01:00
Michael Vogt
3a6bf34284
date: fix date -f dates.txt is failing (#6148)
* date: fix `date -f dates.txt is failing`

This commit is a trivial followup for:
https://github.com/uutils/coreutils/pull/4917
and
https://github.com/uutils/parse_datetime/pull/12

The functionality to parse the datetime was moved into the parse_datetime
crate and the only (tiny) piece left is to call it from `date`.

It also adds the test-case from the original issue. I did not include
the two tests from PR#4917 because they appear to work even without
this change. I am happy to include them of course if prefered.

Closes: #4657

Thanks to Ben Schofield

* tests: tweak changes to test_date.rs to be more idiomatic

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2024-03-30 15:17:10 +01:00
Daniel Hofstetter
eca8bafcc1
Merge pull request #6147 from sylvestre/tail-pid
tail: allow multiple usage of --pid to match upstream (regression of …
2024-03-30 14:07:33 +01:00
Michael Vogt
b703ec8795
tests: fix formating of test_touch.rs
Thanks to Sylvestre!

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2024-03-30 12:31:07 +01:00
Michael Vogt
a2f8084d48 tests: fix deprecation warning timestamp_subsec_nanos()
When building coreutils I got the following deprecation warning:
```
warning: use of deprecated method `chrono::NaiveDateTime::timestamp_subsec_nanos`: use `.and_utc().timestamp_subsec_nanos()` instead
  --> tests/by-util/test_touch.rs:37:59
   |
37 | ..._utc().timestamp(), tm.timestamp_subsec_nanos())
   |                           ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: `coreutils` (test "tests") generated 1 warning
```
This commit fixes it.
2024-03-30 11:17:22 +01:00
Daniel Hofstetter
28f7d56f6d
Merge pull request #6146 from sylvestre/mktemp
mktemp: adjust the error message to match 9.5
2024-03-30 08:12:15 +01:00
Sylvestre Ledru
f0286eb77d tail: allow multiple usage of --pid to match upstream (regression of 9.5)
tested by tests/tail/pid
2024-03-30 07:28:31 +01:00
Sylvestre Ledru
ee198126af mktemp: adjust the error message to match 9.5 2024-03-29 21:52:48 +01:00
Ben Wiederhake
e9045be593 tr: fix order inside class [:blank:] 2024-03-29 00:55:34 +01:00
Ben Wiederhake
76a2f2128b tr: guard against regressions of class [:space:] 2024-03-29 00:50:33 +01:00
Sylvestre Ledru
2d7fa36aef
Merge pull request #6106 from sargas/fmt-negative-widths
fmt: allow negative widths as first argument
2024-03-25 13:43:54 +01:00
Terts Diepraam
d060134d97
uniq: print version and help on stdout again (#6123)
* uniq: print version and help on stdout again

* uniq: format test

* uniq: replace redundant closure with fn

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-03-25 09:40:36 +01:00
Terts Diepraam
e4a1455af5
Merge pull request #6114 from BenWiederhake/dev-csplit-repeated-args
csplit: Handle repeated args, fix remainder after error
2024-03-25 09:27:06 +01:00
Joseph Jon Booker
7b928f792c fmt: allow negative widths as first argument
Also fix error messages for consistency with GNU fmt
2024-03-24 20:59:53 -05:00
Daniel Hofstetter
6f07bf10a1
Merge pull request #6112 from BenWiederhake/dev-comm-all-args
comm: Handle duplicated flags and output-delimiter correctly
2024-03-24 16:39:05 +01:00
Ben Wiederhake
388021833e factor: correctly handle repeated flag 2024-03-24 00:07:08 +01:00
Ben Wiederhake
884ef1f54b comm: implement and test correct handling of repeated flags 2024-03-23 23:35:40 +01:00
Ben Wiederhake
801edbbcb4 comm: implement and test correct handling of repeated --output-delimiter 2024-03-23 23:35:40 +01:00
Ben Wiederhake
1fa0b032e5 comm: permit and test separators that contain a hyphen 2024-03-23 23:35:40 +01:00
Ben Wiederhake
27fd3e5d39 csplit: do not emit remainder of input after an error 2024-03-23 23:21:53 +01:00
Ben Wiederhake
44fa2e960a csplit: correctly handle repeated arguments 2024-03-23 23:21:53 +01:00
Sylvestre Ledru
ff1ecf6242
Merge pull request #6108 from BenWiederhake/dev-truncate-reference-create
truncate: correctly handle file (non-)creation
2024-03-23 18:46:16 +01:00
Ben Wiederhake
a1ad751aa9 truncate: deduplicate fifo check, fix handling of missing files
The fifo check used to include 'metadata(filename)?', which would error
if the file does not exist. In our case however, this is not an error.
2024-03-23 17:50:39 +01:00
Ulrich Hornung
066032b1d3
apply different reference sizes for f2fs (android) case 2024-03-23 16:54:19 +01:00
Ben Wiederhake
a3ab064f35 truncate: don't error in --no-create with reference case 2024-03-23 13:57:16 +01:00
Ben Wiederhake
4fcf912c85 truncate: remove two-year-old file-creation todos
In commit 129cfe12b8
2024-03-23 13:57:15 +01:00
Sylvestre Ledru
cf3fe0e566 shred: small improv on the tests 2024-03-23 12:22:32 +01:00
Sylvestre Ledru
bb5111cc71 shred: fails in case of permissions issue 2024-03-23 12:22:32 +01:00
Sylvestre Ledru
f410d0967f shred: if the file is empty, don't run passes on it 2024-03-23 12:22:32 +01:00
Sylvestre Ledru
88ff42e840
Merge pull request #6102 from Krysztal112233/main
lint: fix lints of new Rust version
2024-03-23 12:21:03 +01:00
Krysztal112233
29d14cba51
lint: fix unused_imports on freebsd target. 2024-03-23 17:23:22 +08:00
Krysztal112233
d21dc125d0
lint: fix clippy::suspicious_open_options of project. 2024-03-23 16:49:35 +08:00
Daniel Hofstetter
5e6fa49ef5 more: fix incorrect tests 2024-03-22 15:13:53 +01:00
Krysztal112233
ef8c379370
lint: fix clippy::redundant_clone of test_dd.rs test_cp.rs 2024-03-22 17:38:54 +08:00
Krysztal112233
fd3640482b
lint: fix clippy::unnecessary_to_owned in test_cksum.rs 2024-03-21 23:56:40 +08:00
Krysztal112233
ee09f276a4
lint: fix clippy::useless_format in test_cksum.rs 2024-03-21 23:55:36 +08:00
Daniel Hofstetter
77a67559eb
Merge pull request #5966 from Ideflop/more-implement-argument-pattern
More implement argument pattern
2024-03-21 10:51:31 +01:00
Ulrich Hornung
89110abe97
test_od - re-enable f16 test with newer AVD system image 2024-03-20 23:33:06 +01:00
Daniel Hofstetter
3ad226cf54 fmt: show error if goal > default width 2024-03-20 10:26:11 +01:00
sreehari prasad
660014e532
dd: misc gnu test (#6084)
* dd: check file is a dir for iflag directory

* Improve english

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* dd: stderr output checking for "iflag directory" testcase

* dd: replace #[cfg(unix)] with #[test]

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-03-20 06:55:54 +01:00
Sylvestre Ledru
08172c28c0
Merge pull request #5801 from cre4ture/feature/env_string_args_try_with_shell_words
env: support string args by "-S", "-vS" or "--split-strings"
2024-03-19 19:32:04 +01:00
Daniel Hofstetter
7c8dfca4a7
Merge pull request #6094 from sargas/fmt-small-widths
fmt: Make sure goal is always positive
2024-03-19 16:55:10 +01:00
Joseph Jon Booker
f456b9531f fmt: Make sure goal is always positive
A debug assertion was added to enforce "width >= goal" to catch
that case before a panic in linebreak.rs. A few warnings in linebreak.rs
were addressed as well, and some isize's that should always be positive
(if there's no width/goal bugs) were changed to usizes to catch bugs
earlier.

test_fmt_width is updated to test for the same result as GNU fmt
2024-03-19 08:52:04 -05:00
Ulrich Hornung
c62ba559d0 env: support string args by "-S", "-vS" or "--split-strings" 2024-03-19 00:45:05 +01:00
Ben Wiederhake
133cdde885 cksum: implement and test --base64 output method 2024-03-18 20:59:59 +01:00
Ben Wiederhake
7b219aee63 cksum: implement trivial --tag flag 2024-03-18 20:59:59 +01:00
Ben Wiederhake
edb1eb0a76 cksum: allow repeated flags and arguments 2024-03-18 20:59:59 +01:00
Daniel Hofstetter
2f4969c0e9
Merge pull request #6090 from sylvestre/csplit2
csplit: adjust the error message to match GNU's
2024-03-18 09:33:54 +01:00
Sylvestre Ledru
696615099c
Merge pull request #6088 from cre4ture/fix/gnu_test_dd_not_rewound_sh
`dd` fix gnu test `not-rewound.sh`
2024-03-17 23:03:22 +01:00
Ulrich Hornung
40577177b2
re-use existing fd for stdout even if its a seek-able file
this is important as the fd holds the file offset we need to use
2024-03-17 20:46:49 +01:00
Sylvestre Ledru
b49fbd9a21 csplit: run the file check before the arguments verifications 2024-03-17 19:09:34 +01:00