1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-18 11:11:10 +00:00
Commit graph

1011 commits

Author SHA1 Message Date
Dorian Péron
f2cf08b4e6 test(cksum): fix and un-ignore test_md5_bits 2025-02-03 11:06:47 +01:00
Sylvestre Ledru
717a6921fc
Merge pull request #7246 from RenjiSann/printf-negative-asterisk
printf: negative asterisk param changes alignment
2025-02-02 23:13:56 +01:00
Jeffrey Finkelstein
db280b6e9f printf: error on missing hexadecial escape value
Change `printf` to correctly terminate with an error message when an
escape sequence starts with `\x` but doesn't include a literal
hexadecimal value after. For example, before this commit,

    printf '\x'

would output `\x`, but after this commit, it terminates with an error
message,

    printf: missing hexadecimal number in escape

Fixes #7097
2025-02-02 11:07:31 -05:00
Dorian Peron
dcc2f1b72c printf: remove unneeded Result<> from resolve_asterisk* functions 2025-01-31 16:54:01 +01:00
Dorian Peron
707e346b84 printf: negative asterisk param changes alignement 2025-01-31 16:50:26 +01:00
Sylvestre Ledru
2e09fdcbdf uucore/docs.rs: generate the doc for all features 2025-01-26 19:54:12 +01:00
Daniel Hofstetter
10f43ec936
Merge pull request #7129 from sylvestre/chgrp
chgrp: add option --from
2025-01-24 10:08:35 +01:00
Sylvestre Ledru
4f83924092
Merge branch 'main' into sort-mem-percent 2025-01-23 22:52:00 +01:00
danieleades
5d6a04ab71
Fix clippy warning manual_if_else (#7177)
and enable the rule
2025-01-23 22:49:13 +01:00
Sylvestre Ledru
8e9a4b5f9a chgrp: adjust the output with group 2025-01-23 22:38:38 +01:00
Sylvestre Ledru
5129aba0f0
Merge pull request #7192 from RenjiSann/cksum-fix-error-handling
cksum: Update error and flags handling to improver GNU's match
2025-01-23 22:14:17 +01:00
Sylvestre Ledru
0ba4dad0a6 print_verbose_ownership_retained_as: siplify the function 2025-01-23 22:04:25 +01:00
Dorian Peron
5d0d1c2a9d checksum: rework exit_code setting to make use of the return type, fix logic for --ignore-missing 2025-01-23 17:04:00 +01:00
Dorian Peron
dd17a26dd8 checksum: change verbosity system so --status, --quiet and --warn override each other 2025-01-23 17:04:00 +01:00
Dorian Peron
7fff3670b3 checksum: fix improperly formatted WARNING message 2025-01-23 17:04:00 +01:00
Dorian Peron
11a0b1b505 checksum: move line warning display to process_line loop 2025-01-23 17:03:48 +01:00
Tommaso Fellegara
93e3d08d5f
ls, date: refactor common code for formatting a datetime (#7194)
* refactoring ls and date

* Refactored and integrated ls and date and added tests to the new feature

* Style refactoring
2025-01-22 17:39:00 +01:00
Jeffrey Finkelstein
94c772c082 sort: support percent arguments to -S option
Add support for parsing percent arguments to the `-S` option. The given
percentage specifies a percentage of the total physical memory. For
Linux, the total physical memory is read from `/proc/meminfo`. The
feature is not yet implemented for other systems.

In order to implement the feature, the `uucore::parser::parse_size`
function was updated to recognize strings of the form `NNN%`.

Fixes #3500
2025-01-20 16:24:49 -05:00
Jeffrey Finkelstein
39847a741a Add ParseSizeError::PhysicalMem enum variant 2025-01-20 16:24:49 -05:00
Dorian Peron
ed4edb4b8a cksum: Add crc32b algorithm 2025-01-20 12:08:36 +01:00
Sylvestre Ledru
178f57fad6 uucore: add missing declarations 2025-01-18 21:43:18 +01:00
Yykz
96c17312ea df: fix display of special characters
Replace the display of certain special characters in `df`: ASCII space
for plain space character, ASCII horizontal tab for plain tab
character, and ASCII backslash for plain backslash character.

Co-authored-by: Jeffrey Finkelstein <jeffrey.finkelstein@protonmail.com>
2025-01-16 21:49:58 -05:00
Sylvestre Ledru
b9765a746b
Merge pull request #7121 from sylvestre/prep-release
Prepare release 0.0.29
2025-01-11 17:43:58 +01:00
Sylvestre Ledru
f042a9a222 chmod: remove the option from configure_symlink_and_recursion 2025-01-11 16:46:37 +01:00
Sylvestre Ledru
aef4234fb5 New release 2025-01-11 14:01:27 +01:00
Sylvestre Ledru
bb3741067a chmod/chown/chgrp: deduplicate get metadata 2025-01-11 12:48:30 +01:00
Sylvestre Ledru
1a0f41e4cc chmod/chown/chgrp: deduplicate some arg management 2025-01-11 12:48:30 +01:00
jfinkels
43c7dfdd91 uucore: remove mention of crash in docs
The `crash!` macro has been removed in https://github.com/uutils/coreutils/pull/7084
2025-01-10 09:34:39 +01:00
Daniel Hofstetter
51f4bfa1a9 uucore: use is_some_and instead of map_or 2025-01-10 08:55:45 +01:00
Saúl Valdelvira
6f35be40e8 uucore: Remove crash! macro 2025-01-07 17:37:10 +01:00
Daringcuteseal
35a044b532
uucore/buf-copy: delete redundant functions 2025-01-03 18:11:18 +07:00
Alexander Shirokov
4c330d43ba
uucore:format:fix floating-point rounding
This change resolves issues with exponent calculation and usage,
ensuring more accurate formatting:

- Exponent for negative values can differ from 0
- Switching to decimal mode now follows the P > X ≥ −4 rule
2024-12-31 13:19:43 +01:00
Jeffrey Finkelstein
cccab35337 seq: improve error handling for invalid -f values
Improve the error message produced by `seq` when given invalid format
specifiers for the `-f` option. Before this commit:

    $ seq -f "%" 1
    seq: %: invalid conversion specification
    $ seq -f "%g%" 1
    seq: %: invalid conversion specification

After this commit:

    $ seq -f "%" 1
    seq: format '%' ends in %
    $ seq -f "%g%" 1
    seq: format '%g%' has too many % directives

This matches the behavior of GNU `seq`.
2024-12-30 12:30:26 -05:00
Daniel Hofstetter
dddbc17c59
Merge pull request #7017 from sylvestre/chmod-L
ch*: Remove duplicate declarations + start to plug it to chmod too
2024-12-29 17:03:13 +01:00
Sylvestre Ledru
438c3c93b2
Merge pull request #6965 from DaringCuteSeal/install-stream
install: implement copying from streams
2024-12-29 16:42:24 +01:00
Sylvestre Ledru
e45c56b926 ch*: also remove duplications for deref & no deref 2024-12-29 16:32:59 +01:00
Sylvestre Ledru
6de5aa7ac7 ch*: improve the presentation 2024-12-29 16:32:59 +01:00
Sylvestre Ledru
836351dd7a ch*: refactor duplicate declarations 2024-12-29 16:32:59 +01:00
Daringcuteseal
a45731eed8
uucore/buf_copy: delete empty doc-string 2024-12-29 20:10:53 +07:00
Sylvestre Ledru
48eb8d8703
Add procps to the spell ignore list 2024-12-29 10:20:34 +01:00
Dorian Péron
0a0db41a2c chore(clippy): fix clippy warnings 2024-12-29 04:40:07 +01:00
Pearl
edf8be5e08
uucore/buf_copy: Improve the uucore integration (#6983)
---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2024-12-28 15:30:10 +01:00
Sylvestre Ledru
2deeb7882c xattr feature: enable it on mac too 2024-12-26 17:25:12 +01:00
Daniel Hofstetter
392c48002c cut: don't merge adjacent ranges 2024-12-22 15:07:04 +01:00
Sylvestre Ledru
bb2fb66073
Merge pull request #6882 from jtracey/quoting_style_bytes
quoting_style: Add support for non-UTF-8 bytes
2024-12-21 23:17:43 +01:00
Justin Tracey
db1ed4c094
core: improve OsStr(ing) helpers
This adds the `os_str_as_bytes_lossy` function, for when we want infallible
conversion across platforms, and improves the doc comments of similar functions
to be more accurate and better formatted.
2024-12-19 17:10:16 -05:00
Santeri Paavolainen
2ae914b268
uucore: correctly truncate response if getgroups shrinks (#6978)
The code above this line handles the case if `res` is
larger than `ngroups`, but `res < ngroups` is also a possibility,
which this line attempts to address but actually does not.

The original code resizes to `ngroups` which is a no-op (given
that `groups` is already `ngroups` size). The correct target for
re-sizing the `groups` is the result from the last `getgroups`,
i.e., `res`.
2024-12-19 13:54:24 +01:00
Daringcuteseal
625c49d0fe
uucore: add common splice-write functionality
Splice is a Linux-specific syscall that allows direct data copying from
    one file descriptor to another without user-space buffer. As of now, this
    is used by `cp`, `cat`, and `install` when compiled for Linux and Android.
2024-12-19 18:32:11 +07:00
Justin Tracey
43229ae104
quoting_style: use and return OsStrings
This exposes the non-UTF-8 functionality to callers. Support in `argument`,
`spec`, and `wc` are implemented, as their usage is simple. A wrapper only
returning valid unicode is used in `ls`, since proper handling of OsStrings
there is more involved (outputs that escape non-unicode work now though).
2024-12-18 15:28:39 -05:00
Justin Tracey
2331600f4c
quoting_style: fix multi-byte control characters 2024-12-18 15:28:28 -05:00