Sylvestre Ledru
2ae14a393a
Merge pull request #7408 from sylvestre/head-error
...
head: improve error mgmt.
2025-03-07 14:02:07 +01:00
Sylvestre Ledru
02da79bfaf
head: remove debug info
2025-03-07 11:24:56 +01:00
Sylvestre Ledru
dedd644016
head: improve error mgmt.
...
And provide more details than GNU
Should fix tests/head/head-write-error
2025-03-07 11:24:54 +01:00
Sylvestre Ledru
0e7a26178f
Merge pull request #7213 from cakebaker/kill_add_tests
...
kill: test "-l <number>" & adapt error messages
2025-03-07 08:53:35 +01:00
Zachary Goff-Hodges
1f2bd34ef0
stdbuf: updated 'build.rs' fixed issue #6981
2025-03-05 12:02:11 +01:00
Sylvestre Ledru
d31a19f2c4
Merge pull request #7356 from RenjiSann/expr-fixes
...
expr: Add tests
2025-03-05 11:35:09 +01:00
Sylvestre Ledru
15864bcac1
Merge pull request #7405 from cakebaker/remove_once_cell
...
Remove `once_cell` dependency and use `LazyLock`
2025-03-05 11:34:40 +01:00
Daniel Hofstetter
e177f7a6b0
Remove once_cell dependency & use LazyLock
2025-03-05 11:02:56 +01:00
Daniel Hofstetter
3b9b8c51cf
uucore: remove lazy_static & use LazyLock instead
2025-03-05 10:13:30 +01:00
Daniel Hofstetter
1a316e80c0
cksum: replace is_some_and with is_none_or
...
for better readability
2025-03-05 08:52:08 +01:00
Sylvestre Ledru
cda24c678a
Merge pull request #7400 from cakebaker/mktemp_tr_use_repeat_n
...
mktemp,tr: replace `repeat().take()` with `repeat_n()`
2025-03-04 16:06:09 +01:00
Daniel Hofstetter
da6d00b876
mktemp,tr: replace repeat().take() with repeat_n()
2025-03-04 15:26:38 +01:00
Daniel Hofstetter
aa6c03885a
clippy: fix warnings from unnecessary_map_or lint
2025-03-04 14:53:32 +01:00
Daniel Hofstetter
ac30e4cf92
uucore: replace PanicInfo with PanicHookInfo
2025-03-04 11:03:18 +01:00
Dorian Peron
a9d8eed217
expr: Remove useless arg in enum variant
2025-03-04 10:27:55 +01:00
Tuomas Tynkkynen
8f119fba5e
uucore: Fix proc_info compilation
...
Fixes #7383
2025-03-03 16:51:35 +02:00
Dorian Péron
76ad6042b5
Merge pull request #7253 from karlmcdowall/head_stdio_file
...
Head: ensure stdin input stream is correct on exit
2025-02-28 17:05:06 +01:00
Dorian Péron
5c29054a40
Merge pull request #7365 from drinkcat/printf-float-hex-exponent
...
printf: (partially) fix hex format: exponent is decimal, correctly print negative numbers
2025-02-28 15:53:39 +01:00
Daniel Hofstetter
854000e394
Merge pull request #7351 from dezgeg/process-sync
...
uucore: Sync proc_info methods from procps
2025-02-28 09:33:09 +01:00
Nicolas Boichat
f23e6f1cab
uucore: format: Fix printing of negative floating hex
...
Negative numbers were not printed correctly with `%a`:
- A leading `-` is expected.
- The exponent mask was too wide (15 bits instead of 11)
2025-02-26 21:42:21 +01:00
Nicolas Boichat
576655b926
uucore: format: Fix printing of floating hex exponents
...
Floating hex format is supposed to be `[-]0xh.hhhp±d`. Note that
the exponent is a decimal value, not an hex number: fix that.
Also, add basic tests for this format, while we're at it.
Test: `cargo test --package uucore --all-features float`
Fixes #7362 .
2025-02-26 21:42:13 +01:00
Karl McDowall
ad20cb35a0
Head: ensure stdin input stream is correct on exit
...
Fix issue #7028
Head tool now ensures that stdin is set to the last character
that was output by the tool. This ensures that if any subsequent
tools are run from the same input stream they will start at the
correct point in the stream.
2025-02-26 11:41:29 -07:00
Daniel Hofstetter
15eaeaec14
Merge pull request #7347 from BigPapa314/cp--fix-don't-show-msg-with-cp--i--v---update=older-a-b-if-a-is-older-than-b
...
cp: disabled verbose output if file has been skipped
2025-02-26 08:48:35 +01:00
Tuomas Tynkkynen
88b93a6865
uucore: Extend proc_info spell checker list
2025-02-25 19:29:45 +02:00
Tuomas Tynkkynen
339a6d4c46
uucore: Sync uid/gid methods from procps
2025-02-25 11:51:20 +02:00
Tuomas Tynkkynen
16c174d826
uucore: Sync thread_ids() method from procps
2025-02-25 11:51:20 +02:00
Dorian Peron
44077e37a8
expr: Do not parse arguments using clap
2025-02-25 01:49:40 +01:00
Thomas Kilian
63fe4fb327
cp: disabled verbose output if file has been skipped
2025-02-24 22:24:27 +01:00
Sylvestre Ledru
81048228cf
Merge pull request #7322 from alexsnaps/issue-7221
...
numfmt: fix Unit::SI uses lowercase `k` suffix for kilos
2025-02-24 19:28:00 +01:00
Dorian Peron
2fc762b9d2
expr: Evaluate parenthesis content before checking for closing parenthesis
2025-02-23 16:22:06 +01:00
Dorian Peron
2670885b4f
expr: Use thiserror to be consistent with error definition in other uutils
2025-02-23 16:22:06 +01:00
Jeffrey Finkelstein
faf3412019
Style fixes from cargo +nightly clippy
2025-02-22 10:11:01 -05:00
jfinkels
4acc59d075
test: add < and > operators for string comparison ( #7315 )
...
* test: add < and > operators for string comparison
Fixes #7254 .
* Add more tests for string inequality
* Use match in place of if/elseif block
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
* Change test name to specify lt/gt operator
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-02-21 14:41:15 +01:00
Daniel Hofstetter
9074f3fe8f
clippy: disable warnings from unnecessary_map_or
...
because fix requires an MSRV of 1.82
2025-02-21 07:54:57 +01:00
Daniel Hofstetter
6c47989186
clippy: fix warning from precedence lint
2025-02-21 07:37:48 +01:00
Sylvestre Ledru
12bb82fac0
Merge pull request #7294 from karlmcdowall/head_read_but_last_n_bug
...
head: Fix bug printing large non-seekable files
2025-02-20 12:09:57 +01:00
Bluemangoo
047ec995f2
uptime: refactor, move some codes to uucore ( #7289 )
2025-02-20 12:09:06 +01:00
Dorian Peron
989b6ba2a0
tr: raise an error when there are two chars or more in an equivalence class
2025-02-19 16:15:40 +01:00
Daniel Hofstetter
99d4fbdd85
Merge pull request #7325 from jfinkels/rm-prompt-message-inaccessible
...
rm: correct prompt for removing inaccessible dir
2025-02-19 10:36:30 +01:00
Jeffrey Finkelstein
2b531b78ef
rm: correct prompt for removing inaccessible dir
...
Change the prompt when attempting to remove an inaccessible
directory. Before this commit, the prompt was
rm: remove write-protected directory 'dir'?
After this commit, the prompt is
rm: attempt removal of inaccessible directory 'dir'?
This required slightly adjusting the logic for which prompt messages to
display under which circumstances.
Fixes #7309 .
2025-02-18 18:39:45 -05:00
Alex Snaps
17a409532f
Fix #7219 : from iec-i without suffix are bytes
...
Signed-off-by: Alex Snaps <alex@wcgw.dev>
2025-02-18 17:17:29 -05:00
Alex Snaps
1250195bce
Fix #7221 : Unit::SI uses lowercase k for kilos
...
Other units remain untouched and use uppercase `K`, as well as all other suffixes
Signed-off-by: Alex Snaps <alex@wcgw.dev>
2025-02-18 15:32:47 -05:00
Sylvestre Ledru
bc995283c4
Merge pull request #7304 from jfinkels/rm-recursive
...
rm: use recursive directory traversal with --recursive
2025-02-18 08:23:05 +01:00
Jeffrey Finkelstein
f979f97214
echo: use uucore::format::parse_escape_only()
...
Remove some duplicate code in favor of just calling
`uucore::format::parse_escape_only()`.
Fixes #7258 .
2025-02-17 17:24:18 -05:00
Jeffrey Finkelstein
1606968bf2
rm: recursive implementation of -r option
...
Change the implementation of `rm -r` so that it is explicitly recursive
so that (1) there is one code path regardless of whether `--verbose` is
given and (2) it is easier to be compatible with GNU `rm`.
This change eliminates a dependency on the `walkdir` crate.
Fixes #7033 , fixes #7305 , fixes #7307 .
2025-02-17 11:18:24 -05:00
Jeffrey Finkelstein
efbc78b8ae
rm: add is_dir_empty() helper function
2025-02-17 11:16:55 -05:00
Jeffrey Finkelstein
78b51cb939
rm: check write permissions instead of readonly()
...
Check the user write permission directly from the mode instead of using
the `Permissions::readonly()` method. This seems to more closely match
the behavior of GNU `rm`.
2025-02-17 11:16:55 -05:00
hamflx
b96f825503
mv: Make mv command fallback to copy only if the src and dst are on different device
2025-02-17 00:22:28 +01:00
Sylvestre Ledru
511590ad44
Merge pull request #7303 from rwdj/fix-5692-usage-strings
...
Fix usage strings for #5692
2025-02-17 00:14:17 +01:00
Jeffrey Finkelstein
464181bb56
rm: simplify remove_dir() helper function
2025-02-16 12:18:37 -05:00