Commit graph

6649 commits

Author SHA1 Message Date
Terts Diepraam
9c8e865b55 all: enable infer long arguments in clap 2022-01-29 02:06:29 +01:00
Sylvestre Ledru
f1d72018d7
Merge pull request #2923 from jfinkels/seq-error-zero-increment-value
seq: correct error message for zero increment
2022-01-29 01:25:57 +01:00
Sylvestre Ledru
c702154a84
Merge pull request #2934 from jfinkels/truncate-division-by-zero
truncate: add a division by zero error
2022-01-29 01:25:10 +01:00
Sylvestre Ledru
fed5ca4ba9
Merge pull request #2935 from tertsdiepraam/wc-unusual-files
wc: fix counting files from pseudo-filesystem
2022-01-29 01:09:02 +01:00
Sylvestre Ledru
68b6a3e5d8
Merge pull request #2937 from sylvestre/doc-ci
Fix the doc warnings and add a check to make sure we don't regress
2022-01-29 01:08:10 +01:00
Sylvestre Ledru
b94bd96bc6 ignore spelling issue 2022-01-29 00:35:16 +01:00
Sylvestre Ledru
170975aeaa run the build of the doc in the ci 2022-01-29 00:35:14 +01:00
Sylvestre Ledru
7f79fef2cd fix various doc warnings 2022-01-29 00:09:09 +01:00
Terts Diepraam
dd311b294b wc: fix counting files from pseudo-filesystem 2022-01-28 19:08:44 +01:00
Jeffrey Finkelstein
9dda23d8c6 seq: correct error message for zero increment
Change a word in the error message displayed when an increment value
of 0 is provided to `seq`. This commit changes the message from "Zero
increment argument" to "Zero increment value" to match the GNU `seq`
error message.
2022-01-27 21:17:27 -05:00
Jeffrey Finkelstein
1e5e637990 truncate: add a division by zero error
Add an error for division by zero. Previously, running `truncate -s /0
file` or `-s %0` would panic due to division by zero. After this
change, it writes an error message "division by zero" to stderr and
terminates with an error code.
2022-01-27 21:12:59 -05:00
Jeffrey Finkelstein
1074deeb03 truncate: make better use of UResult
Replace some uses of `crash!()` and move `UError` handling down into
the `truncate()` function. This does not change the behavior of the
program, just organizes the code to facilitate introducing code to
handle other types of errors in the future.
2022-01-27 21:05:34 -05:00
Sylvestre Ledru
b816e80e2f
Merge pull request #2912 from jfinkels/truncate-create-non-existent-file
truncate: create non-existent file by default
2022-01-27 23:03:55 +01:00
Sylvestre Ledru
53f2aab5be
Merge pull request #2919 from jtracey/patch-3
update GNU coreutils version in GnuTests workflow
2022-01-27 20:12:53 +01:00
Sylvestre Ledru
ac1ed328fe
Merge pull request #2921 from tertsdiepraam/fix-make-clean
make: use "cargo clean" instead of removing the target/$profile folder
2022-01-26 20:42:03 +01:00
Terts Diepraam
d12459563c make: use "cargo clean" instead of removing the target/$profile folder 2022-01-26 19:48:31 +01:00
Sylvestre Ledru
9dbff22101
Merge pull request #2918 from jfinkels/seq-format-option
seq: implement -f FORMAT option
2022-01-26 09:55:50 +01:00
Justin Tracey
2ccea4666d
update GNU coreutils version in GnuTests workflow 2022-01-26 05:23:28 +00:00
Jeffrey Finkelstein
4fbe2b2b5e seq: implement -f FORMAT option
Add support for the `-f FORMAT` option to `seq`. This option instructs
the program to render each value in the generated sequence using a
given `printf`-style floating point format. For example,

    $ seq -f %.2f 0.0 0.1 0.5
    0.00
    0.10
    0.20
    0.30
    0.40
    0.50

Fixes issue #2616.
2022-01-25 20:48:26 -05:00
Sylvestre Ledru
f1dde86f9b
Merge pull request #2903 from jtracey/ls-test-clippy
ls: fix clippy lints in tests
2022-01-25 23:24:40 +01:00
Sylvestre Ledru
c7fc0a703b
Merge pull request #2893 from g-k/2888-rand-0.8
update rand crate to 0.8
2022-01-25 23:23:43 +01:00
Sylvestre Ledru
5932937952
Merge pull request #2777 from jfinkels/uucore-printf
uucore: move printf::memo module to uucore
2022-01-25 23:22:27 +01:00
Sylvestre Ledru
5c45911c13
Merge pull request #2915 from jfinkels/dd-status-noxfer
dd: correct behavior when status=noxfer
2022-01-25 23:19:53 +01:00
Sylvestre Ledru
630b5d8577
Merge pull request #2909 from jfinkels/dd-conv-ascii-unblock
dd: block/unblock on ebcdic/ascii conversions
2022-01-25 14:37:20 +01:00
Sylvestre Ledru
8f12b5b7ce
Merge pull request #2905 from jfinkels/update-main-branch-name-in-workflows
ci: update default branch to "main" in workflows
2022-01-25 14:34:22 +01:00
Sylvestre Ledru
b5df3723df
Merge pull request #2897 from tertsdiepraam/mdbook
Automatic mdBook Documentation
2022-01-25 14:33:41 +01:00
Sylvestre Ledru
1415ebc263
Merge pull request #2908 from cohosh/join_chkodr_default
join: fix default check order behaviour
2022-01-25 13:47:34 +01:00
Sylvestre Ledru
c74cfdc33e
Merge pull request #2916 from jfinkels/tail-follow-non-utf8-bytes
tail: don't error when following non-UTF-8 data
2022-01-25 13:47:16 +01:00
Sylvestre Ledru
e6733881d6
Merge pull request #2850 from sbentmar/numfmt-error-handling
numfmt: use UResult in more functions
2022-01-25 13:46:46 +01:00
Jeffrey Finkelstein
83f96ec29d tail: don't error when following non-UTF-8 data
Fix a bug where `tail -f` would terminate with an error due to failing
to parse a UTF-8 string from a sequence of bytes read from the
followed file. This commit replaces the call to `BufRead::read_line()`
with a call to `BufRead::read_until()` so that any sequence of bytes
regardless of encoding can be read.

Fixes #1050.
2022-01-24 21:32:52 -05:00
Greg Guthe
e6fdf0761f factor: ignore quickcheck tests using unhandled large vals
refs: #1559
2022-01-24 20:51:10 -05:00
Greg Guthe
e24ecea1da factor: tests: update Arbitrary impl for Factors
Upstream removed the Gen trait and made the gen method private in
d286e4db20
2022-01-24 20:41:22 -05:00
Greg Guthe
c037382df7 factor: update quickcheck dev dep to 1.0.3
quickcheck <1 uses rand 0.6.x which results in E0599 errors.  Upgrading resolves that error and lets
us remove the older rand version from our deps.

refs: https://stackoverflow.com/questions/56901973/errore0599-no-method-named-gen-found-for-type-mut-g-in-the-current-scope/56902740#56902740
2022-01-24 20:41:20 -05:00
Greg Guthe
2b19dd20ae cspell: add impls to abbrevs in acronyms+names list 2022-01-24 20:40:57 -05:00
Greg Guthe
a950c98bcf cspell: add endianness to jargon list 2022-01-24 20:40:57 -05:00
Greg Guthe
a6f8d1d9fd shuf: fix crate relative import for vendored rand read adapter 2022-01-24 20:40:57 -05:00
Greg Guthe
2630894658 shuf: remove ReadRng deprecation notices 2022-01-24 20:40:57 -05:00
Greg Guthe
6bcca01e83 shuf: add deprecated rand crate ReadRng adapter
It is deprecated pending future removal. This version copied from:
https://github.com/rust-random/rand/blob/0.8.4/src/rngs/adapter/read.rs
2022-01-24 20:40:55 -05:00
Greg Guthe
a342df03f0 tests: update factor Distribution<Factors> sample to take range 2022-01-24 20:40:31 -05:00
Greg Guthe
1e0dc6c278 tests: update test_random to take range
Fix 'error[E0061]: this function takes 1 argument but 2 arguments were supplied'.
2022-01-24 20:40:31 -05:00
Greg Guthe
771c9f5d9c tests: update random_chars generator to map u8 to char
Fix 'value of type `char` cannot be built from `std::iter::Iterator<Item=u8>`' for split test.

refs: https://docs.rs/rand/0.8.4/rand/distributions/struct.Alphanumeric.html#example
2022-01-24 20:40:31 -05:00
Greg Guthe
cae6bc5e82 deps: update rand to 0.8
fix: #2888
2022-01-24 20:40:29 -05:00
Jeffrey Finkelstein
80ac2619e4 dd: correct behavior when status=noxfer
Correct the behavior of `dd` with the `status=noxfer` option. Before
this commit, the status output was entirely suppressed (as happens
with `status=none`). This was incorrect behavior. After this commit,
the input/output counts are printed to stderr as expected.

For example,

    $ printf "" | dd status=noxfer
    0+0 records in
    0+0 records out

This commit also updates a unit test that was enforcing the wrong
behavior.
2022-01-23 17:36:14 -05:00
Terts Diepraam
d2fe245192
Merge pull request #2502 from hbina/hbina-tr-reimplement-expansion
`tr`: Expanding expansion module
2022-01-23 19:08:00 +01:00
Sylvestre Ledru
bb77ff344d
Merge pull request #2910 from jfinkels/build-gnu-dd-printf
util: replace all instances of printf in tests/dd/ascii.sh
2022-01-23 18:33:30 +01:00
Jeffrey Finkelstein
129cfe12b8 truncate: create non-existent file by default
Fix the behavior of truncate when given a non-existent file so that it
correctly creates the file before truncating it (unless the
`--no-create` option is also given).
2022-01-23 11:24:53 -05:00
Jeffrey Finkelstein
1c8df122d7 dd: block/unblock on ebcdic/ascii conversions
Update `dd` so that the conversion `conv=ascii` implies `conv=unblock`
and, symmetrically, the conversion `conv=ebcdic` implies `conv=block`.
2022-01-23 09:57:37 -05:00
Jeffrey Finkelstein
ec3bcf4067 util: replace all instances of printf
Add the `g` flag to one of the regular expression substitutions in
`util/build-gnu.sh` so that all instances of `printf` are replaced
with `/usr/bin/printf` in `tests/dd/ascii.sh` instead of just one
instance per line.
2022-01-23 09:52:25 -05:00
Cecylia Bocovich
c8f9ea5b15
tests/join: test default check order behaviour 2022-01-22 17:51:29 -05:00
Cecylia Bocovich
594157d1e0
join: fix default check order behaviour
If neither --nocheck-order or --check-order are specified, only fail on
unsorted inputs if either file contains unpaired lines.
2022-01-22 17:51:29 -05:00