chordtoll
a84202ee00
Combine 4 duplicate seek/skip parsing functions into one
2022-03-18 20:45:04 +01:00
chordtoll
b77b3cba55
dd: implement iseek + oseek flags
...
These are the first half of changes needed to pass the dd/bytes.sh tests:
- Add iseek and oseek options (additive with skip and seek options)
- Implement tests for the new flags, matching those from dd/bytes.sh
2022-03-18 20:45:04 +01:00
Benjamin Bouvier
65f94c9d39
Remove duplicate paste dependency
2022-03-18 20:44:01 +01:00
Sylvestre Ledru
9796e01df6
Revert "split: implement round-robin arg to --number"
2022-03-18 14:45:29 +01:00
Terts Diepraam
04de1251dd
Merge branch 'main' into dependabot/cargo/clap-3.1.6
2022-03-18 09:54:04 +01:00
Benjamin Bouvier
ba5b2dc2ed
Remove unused dependencies by individual crates ( #3264 )
2022-03-17 22:48:17 +01:00
Terts Diepraam
20212be4c8
fix clippy errors related to clap upgrade from 3.0.10 to 3.1.6
2022-03-17 22:46:56 +01:00
dependabot[bot]
59440d35c0
build(deps): bump clap from 3.0.10 to 3.1.6
...
Bumps [clap](https://github.com/clap-rs/clap ) from 3.0.10 to 3.1.6.
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/v3.0.10...v3.1.6 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-03-17 13:06:29 +00:00
Sylvestre Ledru
a5948ce11b
Merge pull request #3155 from jtracey/gecos-off-by-one
...
pinky: fix off-by-one in GECOS parsing
2022-03-17 13:35:05 +01:00
Sylvestre Ledru
7e05833b96
Merge pull request #3205 from jfinkels/split-round-robin
...
split: implement round-robin arg to --number
2022-03-16 12:35:00 +01:00
Sylvestre Ledru
161db4cdd7
Merge pull request #3259 from jfinkels/df-loops
...
df: separate functions for two main modes of df
2022-03-16 12:00:36 +01:00
Sylvestre Ledru
b84ff35766
Add canonicalized to the ignore spell list
2022-03-16 09:16:01 +01:00
Devin Gunay
b277aa235a
use powi instead of unnecessary powf
...
clippy::suboptimal_flops found a few unnecessary usages of powf (powi is faster)
2022-03-16 00:37:29 -07:00
Jeffrey Finkelstein
f4ca963dca
df: separate functions for two main modes of df
...
Split the code for getting a list of `Filesystem` objects into two
separate functions: one for getting the list of all filesystems (when
running `df` with no arguments) and one for getting only named
filesystems (when running `df` with one or more arguments). This does
not change the behavior of `df` only the organization of the code.
2022-03-15 22:06:55 -04:00
Jeffrey Finkelstein
6f3dcf5998
df: add Filesystem::from_path() function
...
Add the `Filesystem::from_path()` function which produces the
filesystem on which a given path is mounted. The `Filesystem` is taken
from a list of candidate `MountInfo` objects.
2022-03-15 21:56:39 -04:00
Jeffrey Finkelstein
6371eb8298
df: use for loop over filesystems to display rows
...
Replace a loop over `Row` objects with a loop over `Filesystem`
objects when it comes time to display each row of the output
table. This helps with code structure, since the `Filesystem` is the
primary object of interest in the `df` program. This makes it easier
for us to independently vary how the list of filesystems is produced
and how the list of filesystems is displayed.
2022-03-15 19:43:28 -04:00
Jeffrey Finkelstein
18bfd1ac68
split: implement round-robin arg to --number
...
Implement distributing lines of a file in a round-robin manner to a
specified number of chunks. For example,
$ (seq 1 10 | split -n r/3) && head -v xa[abc]
==> xaa <==
1
4
7
10
==> xab <==
2
5
8
==> xac <==
3
6
9
2022-03-15 18:22:44 -04:00
kimono-koans
fa6af85b8e
ls: Fix display of inodes and add allocation size feature ( #3052 )
2022-03-15 16:27:43 +01:00
Sylvestre Ledru
748d414946
Merge pull request #3258 from cakebaker/fix_exclude_type_panic
...
df: fix panic when using -x argument (#3257 )
2022-03-15 16:24:15 +01:00
Sylvestre Ledru
9dea9b4b83
Merge branch 'main' into mkdir-fix
2022-03-15 12:03:47 +01:00
Ryan Gonzalez
2dc3d867d8
cp: Avoid following a destination symlink with -P
...
Previously, given 'cp -P a b', where 'a' and 'b' were both symlinks, cp
would end up replacing the target of 'b'.
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2022-03-14 17:49:42 -05:00
Daniel Hofstetter
433504949d
df: fix panic when using -x argument ( #3257 )
...
Also allow multiple '-x' options
2022-03-14 10:32:42 +01:00
Sylvestre Ledru
8f97283cf3
Merge pull request #3253 from jfinkels/df-filesystem-module-3
...
df: move Filesystem to filesystem.rs
2022-03-14 09:59:28 +01:00
Sylvestre Ledru
dd6d29f389
Merge pull request #3248 from sylvestre/nproc
...
nproc: Improve the GNU compat
2022-03-14 08:32:40 +01:00
Jeffrey Finkelstein
b81f4ef6a7
df: add documentation comments for filesystem.rs
2022-03-13 14:30:15 -04:00
Jeffrey Finkelstein
2fac674317
df: move Filesystem to filesystem.rs
...
Move the `Filesystem` struct into a new module `filesystem.rs`.
2022-03-13 14:30:14 -04:00
Sylvestre Ledru
24b4af768c
nproc: Improve the support of OMP_NUM_THREADS
2022-03-13 18:33:16 +01:00
Sylvestre Ledru
d6dad9f412
Merge pull request #3250 from jfinkels/df-remove-fs-selector
...
df: remove use of FsSelector abstraction
2022-03-13 18:17:49 +01:00
Jeffrey Finkelstein
81e2de498a
df: remove use of FsSelector abstraction
...
Remove the use of the `FsSelector` struct when deciding whether a
filesystem type should be included or excluded from the output
table. Instead, just maintain optional `Vec`s of filesystem types to
exclude and include, and check whether the filesystem type is
contained in one of those. This reduces the amount of code required to
implement these checks, and since the number of types given in the
`include` or `exclude` lists is likely to be small, there should not
be much of a difference in performance.
2022-03-12 20:52:40 -05:00
Jeffrey Finkelstein
1aa6fd1468
timeout: fix bug in --preserve-status mode
...
Fix a bug where `timeout --preserve-status` was not correctly
preserving the status code of the child process if it timed out. When
that happens, the status code of the child process is considered to be
the signal number (in this case, `SIGTERM`). The exit status of
`timeout` is then 128 plus the numeric code associated with `SIGTERM`.
2022-03-12 19:53:11 -05:00
Jeffrey Finkelstein
2d390233fe
timeout: add ExitStatus enumeration
...
Add the `ExitStatus` enumeration in a new module `status.rs` to
contain all the magic numbers in the `timeout` utility.
2022-03-12 19:53:11 -05:00
Sylvestre Ledru
2c6bbcf716
nproc: support --ignore=' 1' as GNU
2022-03-12 19:23:37 +01:00
Sylvestre Ledru
bfd1e14137
Merge pull request #3204 from jfinkels/split-line-bytes
...
split: implement --line-bytes option
2022-03-12 09:45:07 +01:00
OHNONOTAMOTH
094198b22a
Consistent tempfile crate declaration (version 3) ( #3244 )
2022-03-12 09:40:23 +01:00
Sylvestre Ledru
2c10ddf3f4
Merge pull request #3243 from jfinkels/timeout-restructure
...
timeout: refactor helper func for wait-then-signal
2022-03-12 09:38:05 +01:00
Jeffrey Finkelstein
9fae445ca9
df: fix tests of internal helper functions
...
Fix unit tests for the `is_included()` and `filter_mount_list()`
internal helper functions. The function signatures changed but the
tests did not get updated to match.
2022-03-11 22:52:17 -05:00
Jeffrey Finkelstein
a0eed2405c
timeout: refactor helper func for wait-then-signal
...
Factor a helper function `wait_or_kill_process()` out of the main
`timeout()` function. This helper function contains the code to wait
for a child process and send the `SIGKILL` signal if it does not
terminate within a specified amount of time. This does not change the
function of `timeout`, just the organization of the code.
2022-03-11 18:47:30 -05:00
Kartik Sharma
5c5f4ca6ad
df
: Adds support for mount path prefix matching and input path (#3161 )
...
* Adds support for mount path prefix matching and input path
canonicalization
- Sorts mount paths in reverse lexicographical order
- Canonicalize all paths and clear invalid paths
- Checking of mount path prefix matches input path
2022-03-11 09:36:34 +01:00
Sylvestre Ledru
1795272473
Merge pull request #3176 from jfinkels/df-output-columns-2
...
df: implement the --output command-line argument
2022-03-11 09:26:17 +01:00
Jeffrey Finkelstein
77d92883c7
split: implement --line-bytes option
...
Implement the `--line-bytes` option to `split`. In this mode, the
program tries to write as many lines of the input as possible to each
chunk of output without exceeding a specified byte limit. The new
`LineBytesChunkWriter` struct represents this functionality.
2022-03-10 22:51:49 -05:00
Jeffrey Finkelstein
ec048b3857
df: implement the --output command-line argument
...
Implement the `--output` command-line argument, which allows
specifying an exact sequence of columns to display in the output
table. For example,
$ df --output=source,fstype | head -n3
Filesystem Type
udev devtmpfs
tmpfs tmpfs
(The spacing does not exactly match the spacing of GNU `df` yet.)
Fixes #3057 .
2022-03-10 22:50:15 -05:00
Jeffrey Finkelstein
0b07ecdad2
df: use Options.columns field to control output
...
Replace the `Options.show_fs_type` and `Options.show_inode_instead`
fields with the more general `Options.columns`, a `Vec` of `Column`
variants representing the exact sequence of columns to display in the
output. This makes `Options` able to represent arbitrary output column
display configurations.
2022-03-10 22:50:15 -05:00
Jeffrey Finkelstein
b42168e9dc
Clippy fixes in multiple crates
2022-03-10 22:31:21 -05:00
Sylvestre Ledru
2e8945ba7f
Merge pull request #3221 from uutils/dependabot/cargo/unicode-segmentation-1.9.0
...
build(deps): bump unicode-segmentation from 1.8.0 to 1.9.0
2022-03-10 00:32:13 +01:00
dependabot[bot]
fc4f1d869e
build(deps): bump strum from 0.23.0 to 0.24.0
...
Bumps [strum](https://github.com/Peternator7/strum ) from 0.23.0 to 0.24.0.
- [Release notes](https://github.com/Peternator7/strum/releases )
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md )
- [Commits](https://github.com/Peternator7/strum/commits )
---
updated-dependencies:
- dependency-name: strum
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-03-09 19:45:40 +01:00
dependabot[bot]
b4ee7f84fa
build(deps): bump unicode-segmentation from 1.8.0 to 1.9.0
...
Bumps [unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation ) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/unicode-rs/unicode-segmentation/releases )
- [Commits](https://github.com/unicode-rs/unicode-segmentation/commits )
---
updated-dependencies:
- dependency-name: unicode-segmentation
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-03-09 19:45:35 +01:00
Daniel Hofstetter
3317fb9924
df: always round up usage percentage ( #3208 )
2022-03-08 15:13:05 +01:00
Justin Tracey
644c99ed2e
pinky: simplify and debug printing files
2022-03-07 12:32:07 -05:00
Justin Tracey
9430a9f355
pinky: fix off-by-one in GECOS parsing
2022-03-07 12:32:07 -05:00
Sylvestre Ledru
37a0a74c19
Merge pull request #3033 from water-ghosts/cp-lb
...
cp: Create backup before hardlink
2022-03-07 08:18:36 +01:00
Sylvestre Ledru
76cb746aca
Merge pull request #3191 from jfinkels/df-block-size-heading
...
df: fix block size header for multiples of 1024
2022-03-07 08:09:03 +01:00
Sylvestre Ledru
858a38c815
Merge pull request #3222 from uutils/dependabot/cargo/once_cell-1.10.0
...
build(deps): bump once_cell from 1.9.0 to 1.10.0
2022-03-07 07:04:15 +01:00
dependabot[bot]
1c469ec6c5
build(deps): bump ouroboros from 0.10.1 to 0.14.2
...
Bumps [ouroboros](https://github.com/joshua-maros/ouroboros ) from 0.10.1 to 0.14.2.
- [Release notes](https://github.com/joshua-maros/ouroboros/releases )
- [Commits](https://github.com/joshua-maros/ouroboros/commits/0.14.2 )
---
updated-dependencies:
- dependency-name: ouroboros
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-03-06 22:36:00 +00:00
dependabot[bot]
2e50eade7f
build(deps): bump once_cell from 1.9.0 to 1.10.0
...
Bumps [once_cell](https://github.com/matklad/once_cell ) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/matklad/once_cell/releases )
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md )
- [Commits](https://github.com/matklad/once_cell/compare/v1.9.0...v1.10.0 )
---
updated-dependencies:
- dependency-name: once_cell
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-03-06 22:35:33 +00:00
Sylvestre Ledru
9113594951
Merge pull request #3206 from 353fc443/timeout-empty-string
...
timeout: avoid panicking for empty string
2022-03-06 23:02:46 +01:00
Sylvestre Ledru
b9953eb883
Merge pull request #3122 from xxyzz/chmod
...
chmod: replace walkdir with std::fs
2022-03-06 23:01:50 +01:00
Devin Gunay
103dffc12e
touch: implement -
( #3158 )
2022-03-06 23:00:42 +01:00
Sylvestre Ledru
54a10e955a
Update of the cargo.lock url to point to the right branch
2022-03-06 22:13:17 +01:00
353fc443 aka Seagull
8ccc45c68c
mkdir: recursive reporting of created directories in verbose mode ( #3217 )
2022-03-06 21:36:08 +01:00
xxyzz
ce385be575
chmod: ignore symbolic links during recursive directory traversal
2022-03-06 09:38:39 +08:00
xxyzz
281ec190e0
chmod: replace walkdir with std::fs
...
walkdir filters some files that need to be modified, for example, files inside an unreadable folder.
2022-03-06 08:40:36 +08:00
Davide Cavalca
19af43222b
Include license text in all published crates
2022-03-05 21:21:46 +01:00
Jeffrey Finkelstein
5cf7139467
df: fix block size header for multiples of 1024
...
Correct the column header printed by `df` when the `--block-size`
argument has a value that is a multiple of 1024. After this commit,
the header looks like "1K" or "4M" or "117G", etc., depending on the
particular value of the block size. For example:
$ df --block-size=1024 | head -n1
Filesystem 1K-blocks Used Available Use% Mounted on
$ df --block-size=2048 | head -n1
Filesystem 2K-blocks Used Available Use% Mounted on
$ df --block-size=3072 | head -n1
Filesystem 3K-blocks Used Available Use% Mounted on
$ df --block-size=4096 | head -n1
Filesystem 4K-blocks Used Available Use% Mounted on
2022-03-05 11:47:45 -05:00
Jeffrey Finkelstein
14e3f50651
df: move BlockSize to a new module, blocks.rs
2022-03-05 11:36:16 -05:00
353fc443
6951e18c41
timeout: avoid panicking for empty string
2022-03-05 14:36:24 +01:00
Sylvestre Ledru
430a6650e0
Merge branch 'main' into cp-lb
2022-03-05 10:33:43 +01:00
Jeffrey Finkelstein
d0ebd1c9d0
df: add support for --total option
...
Add support for the `--total` option to `df`, which displays the total
of each numeric column. For example,
$ df --total
Filesystem 1K-blocks Used Available Use% Mounted on
udev 3858016 0 3858016 0% /dev
...
/dev/loop14 63488 63488 0 100% /snap/core20/1361
total 258775268 98099712 148220200 40% -
2022-03-05 10:29:46 +01:00
Jeffrey Finkelstein
41acdb5471
df: borrow Row in DisplayRow::new()
...
Change the signature of `DisplayRow::new()` to borrow `Row` instead of
consuming it, so that the `Row` can be used after it is displayed.
2022-03-05 10:29:46 +01:00
Jeffrey Finkelstein
3fb36d02e3
df: add unit tests for internal helper functions
...
Add unit tests in the `df.rs` file for internal helper functions
`mount_info_lt()`, `is_best()`, `is_included()`, and
`filter_mount_list()`.
2022-03-05 10:28:37 +01:00
Jeffrey Finkelstein
ee36dea1a9
split: implement outputting kth chunk of file
...
Implement `-n l/k/N` option, where the `k`th chunk of the input file
is written to stdout. For example,
$ seq -w 0 99 > f; split -n l/3/10 f
20
21
22
23
24
25
26
27
28
29
2022-03-05 10:27:51 +01:00
Terts Diepraam
bb379b5384
pr: fix heuristic for number-lines argument ( #3109 )
2022-03-05 10:26:12 +01:00
Terts Diepraam
75b3cbcfd9
pr: move from getopts to clap
...
fixes
2022-03-05 10:26:12 +01:00
Sylvestre Ledru
25f0423399
Merge branch 'main' into mkdir-fix
2022-03-04 20:38:06 +01:00
Sylvestre Ledru
63cf0d20b4
Merge branch 'main' into cp-lb
2022-03-03 23:02:57 +01:00
Eli Youngs
eace4bc907
cp: Support copying FIFOs with -r ( #3032 )
2022-03-03 22:58:27 +01:00
Terts Diepraam
618a268f61
Merge pull request #3081 from HeroicKatora/main
...
Discuss seq parsing
2022-03-03 22:50:32 +01:00
Sylvestre Ledru
66e9956595
Merge pull request #3156 from jfinkels/dd-cbs-blocks
...
dd: pad partial record with spaces in some cases
2022-03-03 22:35:58 +01:00
Sylvestre Ledru
1c023c6523
Merge pull request #3202 from cakebaker/patch-1
...
cp: fix typo in help text
2022-03-01 10:14:06 +01:00
Sylvestre Ledru
346cfa060b
Merge pull request #2980 from jfinkels/split-lines-2
...
split: add support for "-n l/NUM" option to split
2022-03-01 10:13:44 +01:00
Daniel Hofstetter
5cce2b0d9a
cp: fix typo in help text
2022-02-28 15:16:47 +01:00
Sylvestre Ledru
bbef777c8c
Merge pull request #2998 from tertsdiepraam/cp-override-args
...
`cp`: override args instead of having them conflict
2022-02-28 14:47:53 +01:00
Jeffrey Finkelstein
7273d1f100
df: use safe wrapper function for statfs() func.
...
Replace unsafe code with a safe version of the `statfs()` function
provided by `uucore`.
2022-02-27 17:33:01 -05:00
Sylvestre Ledru
3b48d1273a
Merge pull request #3187 from ndd7xv/install-error-msg
...
install: better error messages when handling invalid arguments
2022-02-26 18:57:17 +01:00
Terts Diepraam
9aca050e4a
cp: override args
...
These arguments should not have been in conflict with each other, but silently override each other.
2022-02-26 10:37:58 +01:00
DevSabb
b8a3795d95
tr: fix octal interpretation of repeat count string ( #3178 )
...
* tr: fix octal interpretation of repeat count string
* tr: fix formatting errors
* tr: fix formatting issues 2
* tr: attempt to bypass spell check error
* tr: fix spell check errors attempt 2
* tr: formatting fixes
Co-authored-by: DevSabb <devsabb@local>
2022-02-25 12:11:53 +01:00
ndd7xv
172be3a8c6
install: better error messages when invalid arguments
...
executing `install` or `install file` no longer panics and insteads returns errors similar to GNU's install when it encounters similar args
2022-02-24 17:58:32 -05:00
Jeffrey Finkelstein
9f71b7ac7f
df: correct links in BlockSize documentation
2022-02-23 21:08:35 -05:00
Sylvestre Ledru
d3ca49128d
Merge pull request #3179 from omertuc/test_u64
...
Improve coverage / error messages from `parse_size` PR
2022-02-23 18:27:14 +01:00
Jeffrey Finkelstein
fc8e9f20ea
df: correctly scale bytes by block size
...
Change `df` so that it correctly scales numbers of bytes by the
default block size, 1024, when neither -h nor -H are specified on the
command-line. Previously, it was not scaling the number of bytes in
this case.
Fixes #3058 .
2022-02-22 22:51:26 -05:00
Jeffrey Finkelstein
dbbee573ab
split: add support for "-n l/NUM" option to split
...
Add support for `split -n l/NUM`. Previously, `split` only supported
`-n NUM`, which splits a file into `NUM` chunks by byte. The `-n
l/NUM` strategy splits a file into `NUM` chunks without splitting
lines across chunks.
2022-02-22 18:44:08 -05:00
Jeffrey Finkelstein
92d461247e
split: extend Strategy::Number to add NumberType
...
Make the `Strategy::Number` enumeration value more general by
replacing the number parameter with a `NumberType` enum parameter.
This allows a future commit to update `split` to support the various
sub-strategies for the `-n`. (This commit does not add support for the
other sub-strategies.)
2022-02-22 18:41:29 -05:00
Omer Tuchfeld
0ce22f3a08
Improve coverage / error messages from parse_size
PR
...
https://github.com/uutils/coreutils/pull/3084 (2a333ab391
) had some
missing coverage and was merged before I had a chance to fix it.
This PR adds some coverage / improved error messages that were missing
from that previous PR.
2022-02-22 22:09:45 +01:00
Sylvestre Ledru
2a333ab391
Merge pull request #3084 from omertuc/u64
...
Fix `parse_size` to use u64 rather than usize for better 32-bit support
2022-02-22 20:47:38 +01:00
Omer Tuchfeld
e9adf979d9
Fix type-error when calling parse_size
from stdbuf
2022-02-22 13:49:20 +01:00
Omer Tuchfeld
468ff8f0b9
Fix type-error when calling parse_size
from od
2022-02-22 13:49:20 +01:00
Gilad Naaman
6856c5dba5
Fix type-error when calling parse_size
from truncate
2022-02-22 13:49:20 +01:00
Gilad Naaman
159a1dc1db
Fix type-error when calling parse_size
from split
2022-02-22 13:49:20 +01:00
Gilad Naaman
8535cd41e0
Fix type-error when calling parse_size
from sort
2022-02-22 13:49:20 +01:00
Omer Tuchfeld
5d861df961
Fix type-error when calling parse_size
from tail
2022-02-22 13:49:20 +01:00
Omer Tuchfeld
8d8e25880e
Fix type-error when calling parse_size
from head
2022-02-22 13:49:20 +01:00
Omer Tuchfeld
0fe6017006
Fix type-error when calling parse_size
from du
2022-02-22 13:49:20 +01:00
Omer Tuchfeld
88dfb8d374
Fix type-error when calling parse_size
from dd
2022-02-22 13:49:15 +01:00
Alex Tibbles
163472ff7b
hashsum: pass spell checker
2022-02-21 20:43:42 -05:00
Alex Tibbles
3a0f292510
hashsum: refactor macro name
2022-02-21 17:04:57 -05:00
Alex Tibbles
afd5fea3c8
hashsum: refactor MD5 to use macro
2022-02-21 17:00:34 -05:00
Alex Tibbles
b1c543b4d2
hashsum: re-factor SHA1 implementation into common macro
2022-02-21 16:58:20 -05:00
Alex Tibbles
00d3c36e8c
update SHA1, SHA2, SHA3 crates
2022-02-21 16:55:59 -05:00
Alex Tibbles
41e9719d6b
upgrade to RustCrypto Hashes MD5 "MD-5" 0.10.1
2022-02-21 16:51:00 -05:00
Alex Tibbles
c8346fd720
hashsum: update hex to 0.4.3
...
Update to API change.
2022-02-21 15:35:46 -05:00
Sylvestre Ledru
6c7decc42b
Merge pull request #3172 from alextibbles/update-strum
...
uniq: update strum to 0.23 latest
2022-02-21 19:28:55 +01:00
Sylvestre Ledru
775588fb18
Merge pull request #3127 from xxyzz/df
...
df: some option changes
2022-02-21 19:08:56 +01:00
Jeffrey Finkelstein
9f367b72e6
dd: pad partial record with spaces in some cases
...
If `conv=block,sync` command-line arguments are given and there is at
least one partial record read from the input (for example, if the
length of the input is not divisible by the value of the `ibs`
argument), then output an extra block of `cbs` spaces.
For example, no extra spaces are printed in this example because the
input is of length 10, a multiple of `ibs`:
$ printf "012\nabcde\n" \
> | dd ibs=5 cbs=5 conv=block,sync status=noxfer \
> && echo $
012 abcde$
2+0 records in
0+1 records out
But in this example, 5 extra spaces are printed because the length of
the input is not a multiple of `ibs`:
$ printf "012\nabcdefg\n" \
> | dd ibs=5 cbs=5 conv=block,sync status=noxfer \
> && echo $
012 abcde $
2+1 records in
0+1 records out
1 truncated record
The number of spaces printed is the size of the conversion block,
given by `cbs`.
2022-02-21 13:00:11 -05:00
Alex Tibbles
0d5dd27e71
uniq: update strum to 0.23 latest
2022-02-21 12:34:25 -05:00
Terts Diepraam
53070141c1
all: add format_usage function ( #3139 )
...
This should correct the usage strings in both the `--help` and user documentation. Previously, sometimes the name of the utils did not show up correctly.
2022-02-21 17:14:03 +01:00
alextibbles
cd450cc591
expr: update onig crate to 6.3 ( #3136 )
...
* expr: update onig crate to 6.3
2022-02-21 17:13:27 +01:00
Sylvestre Ledru
419abec4e5
Merge pull request #3148 from jfinkels/dd-of-dev-null
...
dd: don't error when outfile is /dev/null
2022-02-21 17:10:42 +01:00
Jeffrey Finkelstein
1076fbd492
dd: move block-related functions into new module
...
Create a new module `blocks.rs` to contain the block-related helper
functions. This commit only moves the location of the code and related
tests, it does not change the functionality of `dd`.
2022-02-20 22:16:54 -05:00
Terts Diepraam
938c5acbbe
Merge pull request #3146 from ndd7xv/split-suffix-check
...
split: error when num. of chunks is greater than num. of possible filenames
2022-02-20 17:12:05 +01:00
Sylvestre Ledru
73051809a7
Merge pull request #3018 from Narasimha1997/fix-cp-recursion
...
Fix: Avoid infinite recursion when source and destinations are same while using `cp -R`
2022-02-20 10:34:34 +01:00
Sylvestre Ledru
42eba6c5b2
Merge pull request #3107 from jfinkels/split-elide-empty-files
...
split: add support for -e argument
2022-02-20 10:32:57 +01:00
Sylvestre Ledru
6bf575ad56
Merge branch 'main' into cp-lb
2022-02-20 10:31:13 +01:00
Jeffrey Finkelstein
b09bae2acf
dd: collect progress reporting into its own module
...
Collect structs, implementations, and functions that have to do with
reporting number of blocks read and written into their own new module,
`progress.rs`. This commit also adds docstrings for everything and
unit tests for the significant methods. This commit does not change
the behavior of `dd`, just the organization of the code to make it
more maintainable and testable.
2022-02-19 10:39:40 -05:00
Jeffrey Finkelstein
6900638ac6
dd: don't error when outfile is /dev/null
...
Prevent `dd` from terminating with an error when given the
command-line argument `of=/dev/null`. This commit allows the call to
`File::set_len()` to result in an error without causing the process to
terminate prematurely.
2022-02-19 10:29:09 -05:00
Terts Diepraam
1a7e5c4cc5
Merge pull request #3154 from jfinkels/dd-truncated-records
...
dd: correct order and phrasing of truncated record
2022-02-19 15:58:12 +01:00
Kartik Sharma
c523aa43f2
Fixes missing help on expr
user docs.
...
- Configured clap to take crate version, so version is now visible in docs.
- Added ABOUT string from expr help output, so about section is getting rendered in docs.
- Added USAGE section.
- Added HELP section for each args.
2022-02-19 13:47:16 +05:30
Jeffrey Finkelstein
766c85fb5e
dd: correct order and phrasing of truncated record
...
Place the "truncated records" line below the "records out" line in the
status report produced by `dd` and properly handle the singularization
of the word "record" in the case of 1 truncated record. This matches
the behavior of GNU `dd`.
For example
$ printf "ab" | dd cbs=1 conv=block status=noxfer > /dev/null
0+1 records in
0+1 records out
1 truncated record
$ printf "ab\ncd\n" | dd cbs=1 conv=block status=noxfer > /dev/null
0+1 records in
0+1 records out
2 truncated records
2022-02-18 23:49:33 -05:00
Terts Diepraam
4719717e33
Merge pull request #3128 from jfinkels/dd-zero-multiplier-regression
...
dd: remove spurious zero multiplier warning
2022-02-19 01:37:33 +01:00
Terts Diepraam
625c771d14
Merge pull request #3112 from ndd7xv/err_conv-to-result
...
uucore(memo): replace err_conv with result
2022-02-19 01:29:07 +01:00
Pyokyeong Son
b8c0a87f85
mkdir: fixed permissions behavior with umask
...
- umask application more closely resembles gnu
2022-02-18 07:52:38 +00:00
Pyokyeong Son
6db5bf1652
Merge branch 'uutils:main' into mkdir-fix
2022-02-18 14:04:16 +09:00
ndd7xv
1e12c46c24
uucore(memo): replace err_conv with result
2022-02-17 22:43:30 -05:00
Hanif Ariffin
8acdfdc553
Merge branch 'main' of github.com:uutils/coreutils into hbina-ls-propagate-write-errors
...
Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
2022-02-18 09:48:20 +08:00
Jeffrey Finkelstein
89f428b44f
dd: remove spurious zero multiplier warning
...
Fix a bug in which `dd` was inappropriately showing a warning about a
"0x" multiplier when there was no "x" character in the argument.
2022-02-17 19:06:05 -05:00
Jeffrey Finkelstein
6718d97f97
split: add support for -e argument
...
Add the `-e` flag, which indicates whether to elide (that is, remove)
empty files that would have been created by the `-n` option.
The `-n` command-line argument gives a specific number of chunks into
which the input files will be split. If the number of chunks is
greater than the number of bytes, then empty files will be created for
the excess chunks. But if `-e` is given, then empty files will not be
created.
For example, contrast
$ printf 'a\n' > f && split -e -n 3 f && cat xaa xab xac
a
cat: xac: No such file or directory
with
$ printf 'a\n' > f && split -n 3 f && cat xaa xab xac
a
2022-02-17 19:03:51 -05:00
Terts Diepraam
87dc692889
Merge branch 'main' into split-suffix-check
2022-02-17 23:23:58 +01:00
Terts Diepraam
e1a611374a
Merge pull request #2981 from jfinkels/split-hex-numbers
...
split: add support for -x option (hex suffixes)
2022-02-17 23:20:58 +01:00
Terts Diepraam
b082b98b7c
Merge pull request #3056 from palaster/fix-issue-2870
...
seq: Eliminated special handling of -0.0
2022-02-17 23:18:54 +01:00
Sylvestre Ledru
8e79b7fcb8
Merge pull request #3141 from jfinkels/dd-modules
...
dd: move unit tests into dd.rs and test_dd.rs
2022-02-17 10:15:07 +01:00
Pyokyeong Son
65a45ae5e1
Merge branch 'main' of github.com:pyoky/coreutils
2022-02-17 08:22:27 +00:00
Pyokyeong Son
ea175ce252
mkdir: permissions respects umask
...
- hardcoded default permissions changed to ones defined by umask
2022-02-17 07:37:55 +00:00
ndd7xv
494d709e0f
split: small tweaks to wording
...
changes `SuffixType` enums to have better names and hex suffix help to be consistent with numeric suffix help
2022-02-17 01:04:26 -05:00
xxyzz
c16c06ea0d
df: add output option's valid field names
2022-02-17 13:43:59 +08:00
ndd7xv
6c3fc7b214
split: throw error when # chunks > # filenames from suffix length
2022-02-16 23:53:56 -05:00
Jeffrey Finkelstein
4470430c89
split: add support for -x option (hex suffixes)
...
Add support for the `-x` command-line option to `split`. This option
causes `split` to produce filenames with hexadecimal suffixes instead
of the default alphabetic suffixes.
2022-02-16 23:53:56 -05:00
Jeffrey Finkelstein
891c5d1ffa
split: add SuffixType::NumericHexadecimal
...
Add a `NumericHexadecimal` member to the `SuffixType` enum so that a
future commit can add support for hexadecimal filename suffixes to the
`split` program.
2022-02-16 23:53:56 -05:00
Jeffrey Finkelstein
aa4c5aea50
split: refactor to add SuffixType enum
...
Refactor the code to use a `SuffixType` enumeration with two members,
`Alphabetic` and `NumericDecimal`, representing the two currently
supported ways of producing filename suffixes. This prepares the code
to more easily support other formats, like numeric hexadecimal.
2022-02-16 23:53:56 -05:00
Terts Diepraam
9e847c33e3
Merge pull request #3021 from iovanom/dd-multi-status-options
...
dd: allow multiple instances of arguments
2022-02-16 12:56:30 +01:00
Jeffrey Finkelstein
ba1ce7179b
dd: move unit tests into dd.rs and test_dd.rs
...
Clean up unit tests in the `dd` crate to make them easier to
manage. This commit does a few things.
* move test cases that test the complete functionality of the `dd`
program from the `dd_unit_tests` module up to the
`tests/by-util/test_dd.rs` module so that they can take advantage of
the testing framework and common testing tools provided by uutils,
* move test cases that test internal functions of the `dd`
implementation into the `tests` module within `dd.rs` so that they
live closer to the code they are testing,
* replace test cases defined by macros with test cases defined by
plain old functions to make the test cases easier to read at a
glance.
2022-02-15 21:50:48 -05:00
Michael Lohmann
3bbfe00791
cat: write_nonprint_to_end: be more explicit about printing '?'
2022-02-15 22:27:46 +01:00
Michael Lohmann
4676924532
cat: cat_path does not need to parse InputType for stdin itself
...
This type is already handled by get_input_type, so we can unify the handling
2022-02-15 22:27:46 +01:00
Michael Lohmann
34b18351e2
cat: cleanup write_tab_to_end duplication of logic
...
The logic for '\n' and '\r' about the number of written characters was duplicated
2022-02-15 22:16:02 +01:00
Sylvestre Ledru
65467ab317
Merge pull request #3137 from tertsdiepraam/docs-multiline-usage
...
docs: allow for multiline usage
2022-02-15 10:26:47 +01:00
DevSabb
6d6371741a
include io-blksize parameter ( #3064 )
...
* include io-blksize parameter
* format changes for including io-blksize
Co-authored-by: DevSabb <devsabb@local>
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2022-02-14 19:47:18 +01:00
xxyzz
c849b8722f
df: --output
option conflicts with -i
, -P
, -T
2022-02-14 09:10:54 +08:00
xxyzz
e77c8ff381
df: -t
may appear more than once and doesn't support delimiter
2022-02-14 09:09:35 +08:00
Terts Diepraam
477b40f1e5
shuf: correct execution phrase for --help
2022-02-13 21:58:48 +01:00
Kartik Sharma
6c1a655512
This commit removes empty line from USAGE string in src/uu/od/src/od.rs. ( #3074 )
...
This change is needed to fix missing USAGE section for `od` in user docs.
With reference to this issue
https://github.com/uutils/coreutils/issues/2991 , and missing USAGE
section from `od docs` at
https://uutils.github.io/coreutils-docs/user/utils/od.html , it was
found that the USAGE for od app was starts with an empty line and uudoc
only takes 1st line for using in USAGE section in docs.
This resulted in empty line in usage section for `od`
2022-02-13 21:39:11 +01:00
Terts Diepraam
351a56d3fd
Merge pull request #3133 from sylvestre/issue-3132
...
expr: Use chars().count() as we can have some multibytes chars
2022-02-13 17:48:37 +01:00
Jeffrey Finkelstein
a4955b4e06
split: add support for -x option (hex suffixes)
...
Add support for the `-x` command-line option to `split`. This option
causes `split` to produce filenames with hexadecimal suffixes instead
of the default alphabetic suffixes.
2022-02-13 11:18:37 -05:00
Jeffrey Finkelstein
494dc7ec57
split: add SuffixType::NumericHexadecimal
...
Add a `NumericHexadecimal` member to the `SuffixType` enum so that a
future commit can add support for hexadecimal filename suffixes to the
`split` program.
2022-02-13 11:18:37 -05:00
Jeffrey Finkelstein
7fbd805713
split: refactor to add SuffixType enum
...
Refactor the code to use a `SuffixType` enumeration with two members,
`Alphabetic` and `NumericDecimal`, representing the two currently
supported ways of producing filename suffixes. This prepares the code
to more easily support other formats, like numeric hexadecimal.
2022-02-13 11:18:37 -05:00
Sylvestre Ledru
7225fb6c24
expr: Use chars().count() as we can have some multibytes chars
...
Partially fixes #3132
Fixes one of the test of tests/misc/expr-multibyte
2022-02-13 14:19:25 +01:00
Terts Diepraam
85c4fb3981
Merge pull request #3129 from jfinkels/dd-partial-records
...
dd: correctly account for partial record written
2022-02-13 12:52:09 +01:00
Jeffrey Finkelstein
3ada6af19d
dd: correctly account for partial record written
...
Correct the accounting for partial records written by `dd` to the
output file. After this commit, if fewer than `obs` bytes are written,
then that is counted as a partial record. For example,
$ printf 'abc' | dd bs=2 status=noxfer > /dev/null
1+1 records in
1+1 records out
That is, one complete record and one partial record are read from the
input, one complete record and one partial record are written to the
output. Previously, `dd` reported two complete records and zero
partial records written to the output in this case.
2022-02-12 22:38:25 -05:00
Jeffrey Finkelstein
b6d1aa3e73
df: always produce the same order in output table
...
Change the `filter_mount_list()` function so that it always produces
the same order of `MountInfo` objects. This change ultimately results
in `df` printing its table of filesystems in the same order on each
execution. Previously, the table was in an arbitrary order because the
`MountInfo` objects were read from a `HashMap`.
Fixes #3086 .
2022-02-12 21:14:14 -05:00
Jeffrey Finkelstein
042e537ca8
df: refactor is_included(), mount_info_lt() funcs
...
Factor two helper functions, `is_included()` and `mount_info_lt()`,
from the `filter_mount_list()` function.
2022-02-12 21:06:37 -05:00
Jeffrey Finkelstein
b13718e742
head: use Self instead of enum name Mode in method
2022-02-12 14:45:45 -05:00
Sylvestre Ledru
f9e04ae5ef
Merge pull request #2966 from allan-silva/wc-files0-from-opt
...
wc: implement files0-from option
2022-02-12 19:05:05 +01:00
Sylvestre Ledru
0ed5e2c884
Merge pull request #2957 from jfinkels/head-preserve-no-final-newline
...
head: don't add trailing newline to end of file that didn't originally have one
2022-02-12 19:03:13 +01:00
Sylvestre Ledru
0f17ef2028
Merge pull request #2906 from jfinkels/head-better-mode
...
head: incorporate "all but last" option into Mode
2022-02-12 19:01:49 +01:00
Sylvestre Ledru
142c24e579
Merge pull request #2982 from Dr-Emann/paste_cleanup
...
paste: Fixes and cleanup
2022-02-12 19:00:39 +01:00
Sylvestre Ledru
c67a64c9df
Merge pull request #3121 from serhansekman/pr-help-page
...
pr: add missing about and version to documentation
2022-02-12 18:13:31 +01:00
alextibbles
d9c2acc2ed
update to sha 0.10.0 ( #3110 )
...
* update to sha 0.10.0
* correct formatting
2022-02-12 18:12:02 +01:00
Hanif Ariffin
45a1b7e4bb
ls: refactor out padding calculations ( #3072 )
...
* Refactor padding calculations into a function
* Propagate all write and (most) flush errors
2022-02-12 11:39:17 +01:00
Sylvestre Ledru
c2e3f4109c
Merge pull request #2944 from jfinkels/truncate-fifo
...
truncate: error when trying to truncate a fifo
2022-02-12 11:36:17 +01:00
Sylvestre Ledru
52282740dd
Merge pull request #3078 from ndd7xv/dd-progress-fix
...
dd: make status=progress rewrite once/sec
2022-02-12 11:34:21 +01:00
Sylvestre Ledru
090fb07361
Merge pull request #3066 from jfinkels/dd-skip-beyond-file
...
dd: show warning if skipping past end of input
2022-02-12 11:34:06 +01:00
Sylvestre Ledru
6b6d5ee7db
Merge pull request #2827 from jfinkels/split-std-io-copy
...
split: use std::io::copy() with new writer implementation to improve maintainability and speed
2022-02-12 11:33:12 +01:00
Sylvestre Ledru
e76818bb19
Merge pull request #3083 from jfinkels/df-table-module
...
df: refactor data table into Row, Header structs
2022-02-12 11:30:28 +01:00
Sylvestre Ledru
463e160d2f
Merge pull request #3117 from jfinkels/touch-no-deref-no-file
...
touch: show error on -h with nonexistent file
2022-02-12 11:27:46 +01:00
Tevfik Serhan Sekman
ad1954bd16
pr: add missing about and version to documentation
2022-02-12 12:36:28 +03:00
Pat Laster
aacff13ec3
seq: Eliminated special handling of -0.0
2022-02-11 23:02:57 -06:00
Jeffrey Finkelstein
f37e78c25a
touch: show error on -h with nonexistent file
...
Show an error message when running `touch -h` on a nonexistent file.
2022-02-11 20:58:16 -05:00
Sylvestre Ledru
080cb2b6f9
Merge pull request #3108 from DestroyerXyz/blake3
...
hashsum: Add BLAKE3 to Hashing Algorithms
2022-02-11 11:40:10 +01:00
Jeffrey Finkelstein
2f65b29866
split: error when --additional-suffix contains /
...
Make `split` terminate with a usage error when the
`--additional-suffix` argument contains a directory separator
character.
2022-02-10 19:33:33 -05:00
Sylvestre Ledru
e818fd2b98
Merge pull request #3092 from jtracey/join-performance
...
join: improve performance
2022-02-10 22:39:12 +01:00
Abhishek C Sharma
3f6fe7f388
ls: add new optional arguments to --classify flag ( #3041 )
...
* ls: add new optional arguments to --classify flag
The --classify flag in ls now takes an option when argument
that may have the values always, auto and none.
Modified clap argument to allow an optional parameter and
changed the classify flag value parsing logic to account for
this change.
* ls: add test for indicator-style, ind and classify with value none
* ls: require option paramter to --classify to use a = to specify flag value
* ls: account for all the undocumented possible values for the --classify flag
Added the other values for the --classify flag along with modifications to tests.
Also documented the inconsistency between GNU coreutils because we accept the
flag value even for the short version of the flag.
2022-02-10 21:35:20 +01:00
Ivan Majeru
c3b4d898ee
dd: allow multiple occurences for iflag, oflag and conv
...
The iflag, oflag and conv cli arguments take a list of values
and the correct behavior is to collect all values from multiple
occurences of theme.
For example if we call `dd --iflag=directory --iflag=skip_bytes` this should
collect the two values, `directory` and `skip_bytes` for iflag.
The unittest was added for this case.
2022-02-10 18:34:27 +02:00
Shreyans Jain
30d7a4b167
hashsum: Add BLAKE3 to Hashing Algorithms
...
Signed-off-by: Shreyans Jain <shreyansthebest2007@gmail.com>
2022-02-10 12:46:44 +05:30
Hanif Ariffin
4006524798
Merge branch 'main' of github.com:uutils/coreutils into hbina-ls-propagate-write-errors
2022-02-09 16:10:28 +08:00
Sylvestre Ledru
e5be9c1aaf
Merge pull request #3099 from tertsdiepraam/shuf-refactor
...
`shuf`: remove custom logic for bounded randomization
2022-02-09 07:37:22 +01:00
Jeffrey Finkelstein
b37718de10
split: add BENCHMARKING.md documentation file
2022-02-08 22:58:00 -05:00
Jeffrey Finkelstein
70ca1f45ea
split: remove unused ByteSplitter and LineSplitter
2022-02-08 22:58:00 -05:00
Jeffrey Finkelstein
1d7e1b8732
split: use ByteChunkWriter and LineChunkWriter
...
Replace `ByteSplitter` and `LineSplitter` with `ByteChunkWriter` and
`LineChunkWriter` respectively. This results in a more maintainable
design and an increase in the speed of splitting by lines.
2022-02-08 22:57:57 -05:00
Jeffrey Finkelstein
b31d63eaa9
split: add ByteChunkWriter and LineChunkWriter
...
Add the `ByteChunkWriter` and `LineChunkWriter` structs and
implementations, but don't use them yet. This structs offer an
alternative approach to writing chunks of output (contrasted with
`ByteSplitter` and `LineSplitter`). The main difference is that
control of which underlying file is being written is inside the writer
instead of outside.
2022-02-08 22:53:56 -05:00
Terts Diepraam
dc24c9563e
shuf: BENCHMARKING.md
2022-02-08 21:05:39 +01:00
Sylvestre Ledru
47b12b31a6
Merge pull request #3006 from jfinkels/split-errors
...
split: correct error message on invalid arg. to -a
2022-02-08 20:51:32 +01:00
Sylvestre Ledru
daaae90113
Merge branch 'main' into dd-skip-beyond-file
2022-02-08 20:46:07 +01:00
Sylvestre Ledru
936ac0db38
Merge pull request #3053 from snobee/stat-handle-negative-time
...
stat: allow formatting of negative numbers
2022-02-08 20:45:21 +01:00
Sylvestre Ledru
12d5139320
Merge pull request #3095 from jfinkels/dd-concise-main-loop
...
dd: make main loop more concise
2022-02-08 20:44:39 +01:00
Terts Diepraam
9538814702
shuf: use split_once for parsing the range
2022-02-08 14:39:32 +01:00
Terts Diepraam
30ae952b83
shuf: remove custom randomization logic
2022-02-08 14:39:32 +01:00
Sylvestre Ledru
9c813be5f1
Merge pull request #3076 from jfinkels/dd-seek-truncate
...
dd: truncate to specified seek length
2022-02-08 11:16:15 +01:00
Justin Tracey
b873d46ca0
join: flush stdout before final error message
2022-02-07 22:32:02 -05:00
Narasimha Prasanna HN
0379fca260
Fix merge conflict in tests/by-util/test_cp.rs
2022-02-07 23:26:06 +05:30
Jeffrey Finkelstein
c002b16c67
dd: make main loop more concise
...
Add some helper functions and adjust some error-handling to make the
`Output::dd_out()` method, containing the main loop of the `dd`
program, more concise. This commit also adds documentation and
comments describing the main loop procedure in more detail.
2022-02-07 10:00:49 -05:00
Allan Silva
e6c94c1cd7
wc: Fix clippy error
2022-02-07 10:20:52 -03:00
Sylvestre Ledru
b14e396983
Merge pull request #3091 from jfinkels/df-flatten-filter-mount-list
...
df: refactor filter_mount_list() to be more flat
2022-02-07 10:59:23 +01:00
Justin Tracey
41c90d79c4
join: add benchmarking documentation
2022-02-06 23:53:03 -05:00
Justin Tracey
ac9d006886
join: guess the number of fields in each line
...
This lets us use fewer reallocations when parsing each line.
The current guess is set to the maximum fields in a line so far. This is
a free performance win in the common case where each line has the same
number of fields, but comes with some memory overhead in the case where
there is a line with lots of fields at the beginning of the file, and
fewer later, but each of these lines are typically not kept for very
long anyway.
2022-02-06 23:37:17 -05:00
Justin Tracey
f33e058a5a
join: faster field parsing and representation
...
Using indexes into the line instead of Vec<u8>s means we don't have to copy
the line to store the fields (indexes instead of slices because it avoids
self-referential structs). Using memchr also empirically saves a lot of
intermediate allocations.
2022-02-06 23:37:17 -05:00
Justin Tracey
e6f59b12f7
join: lock and buffer stdout
...
By abstracting the writer we write to, we can lock stdout once at the
beginning, then use buffered writes to it throughout.
2022-02-06 23:37:17 -05:00
Justin Tracey
c12f393150
join: improve error handling
2022-02-06 23:37:06 -05:00
Jeffrey Finkelstein
9528d514bf
df: refactor data table into Row, Header structs
...
Refactor the code for representing the `df` data table into `Header`
and `Row` structs. These structs live in a new module `table.rs`. When
combined with the `Options` struct, these structs can be
`Display`ed. Organizing the code this way makes it possible to test
the display settings independently of the machinery for getting the
filesystem data. New unit tests have been added to `table.rs` to
demonstrate this benefit.
2022-02-06 21:54:58 -05:00
Jeffrey Finkelstein
9f8ec676c5
dd: show warning if skipping past end of input
...
Show a warning if the `skip=N` command-line argument would cause `dd`
to skip past the end of the input. For example:
$ printf "abcd" | dd bs=1 skip=5 count=0 status=noxfer
'standard input': cannot skip to specified offset
0+0 records in
0+0 records out
2022-02-06 20:10:42 -05:00
Jeffrey Finkelstein
84d4f24b8c
dd: avoid infinite loop in Input::force_fill()
...
Avoid an infinite loop in `Input::force_fill()` when the input has
fewer bytes than are being requested to be read from the input.
2022-02-06 20:10:41 -05:00
Jeffrey Finkelstein
8fa6797255
split: add structure to errors that can be created
...
Add some structure to errors that can be created during parsing of
settings from command-line options. This commit creates
`StrategyError` and `SettingsError` enumerations to represent the
various parsing and other errors that can arise when transforming
`ArgMatches` into `Settings`.
2022-02-06 20:09:29 -05:00
Jeffrey Finkelstein
e5361a8c11
split: correct error message on invalid arg. to -a
...
Correct the error message displayed on an invalid parameter to the
`--suffix-length` or `-a` command-line option.
2022-02-06 20:09:29 -05:00
Jeffrey Finkelstein
572b2e032c
df: refactor filter_mount_list() to be more flat
...
Use a `for` loop in the `filter_mount_list()` function to make the
filtering logic easier to read.
2022-02-06 20:04:03 -05:00
ndd7xv
3842ecb1b4
dd: status=progress rewrites once/sec
2022-02-06 17:56:08 -05:00
Jeffrey Finkelstein
fec662a623
dd: show warning when using 0x size multiplier
...
Show a warning when a block size includes "0x" since this is
ambiguous: the user may have meant "multiply the next number by zero"
or they may have meant "the following characters should be interpreted
as a hexadecimal number".
2022-02-06 17:13:15 -05:00
Sylvestre Ledru
1f7c08d87b
Merge pull request #3028 from jfinkels/dd-multipliers
...
dd: add support for 'b' and 'x' multipliers in numeric arguments
2022-02-06 22:03:54 +01:00
Sylvestre Ledru
1ac45c9961
Merge pull request #3044 from water-ghosts/cp-dir-vs-file
...
cp: Fail when copying a directory to a file
2022-02-06 22:01:37 +01:00
Andreas Molzer
a2e9329918
seq: Allow option to receive immediate arguments
...
WIP: this needs to be adjusted
2022-02-06 09:45:38 -06:00
Sylvestre Ledru
57cf3a533f
Merge pull request #3067 from ndd7xv/printf-clap-defaults
...
printf: use clap default help and version
2022-02-05 22:16:44 +01:00
Jeffrey Finkelstein
1af709f642
dd: truncate to specified seek length
...
When specifying `seek=N` and *not* specifying `conv=notrunc`, truncate
the output file to `N` blocks instead of truncating it to zero before
starting to write output. For example
$ printf "abc" > outfile
$ printf "123" | dd bs=1 skip=1 seek=1 count=1 status=noxfer of=outfile
1+0 records in
1+0 records out
$ cat outfile
a2
Fixes #3068 .
2022-02-05 16:07:44 -05:00
Hanif Ariffin
78847e2ad0
Undo a small change that was meant to silence clippy
...
Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
2022-02-05 23:40:23 +08:00
Hanif Ariffin
519e82240a
Revert "Refactor padding calculations into a function"
...
This reverts commit f39b861469
.
Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
2022-02-05 23:32:44 +08:00
Sylvestre Ledru
ebf33d775e
Merge pull request #3023 from RishiKumarRay/main
...
basenc, base64 and base32 have an ABOUT that's formatted differently than the other utils
2022-02-05 14:40:03 +01:00
Hanif Ariffin
e35b93156a
Propagate all write and (most) flush errors
...
Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
2022-02-05 19:30:39 +08:00
Hanif Ariffin
f39b861469
Refactor padding calculations into a function
...
Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
2022-02-05 19:12:05 +08:00
Sylvestre Ledru
252e30c839
Merge pull request #3046 from hbina/hbina-tail-head-dont-use-is-numeric-to-check-digits
...
tail&head: dont use is_numeric to check for digits
2022-02-05 10:08:01 +01:00
ndd7xv
5e790918ef
printf: use clap default help and version
2022-02-04 22:07:31 -05:00
Allan Silva
6a6875012e
wc: implement files0-from option
...
When this option is present, the files argument is not processed. This option processes the file list from provided file, splitting them by the ascii NUL (\0) character. When files0-from is '-', the file list is processed from stdin.
2022-02-04 10:12:08 -03:00
Sylvestre Ledru
572a505119
Merge pull request #3024 from ndd7xv/printf-version-documentation
...
printf: add description and version
2022-02-04 10:45:28 +01:00
Guilherme Augusto de Souza
ae755bb9bd
test: add version and about ( #3011 )
2022-02-04 10:28:15 +01:00
Sylvestre Ledru
033fd62f6a
Merge pull request #3047 from hbina/hbina-touch-better-msg-when-no-args
...
touch: Better error messages when no args is provided
2022-02-04 10:27:01 +01:00
Jeffrey Finkelstein
639971e520
df: refactor function for parsing CLI args
...
Add a `Options::from()` function to collect the code for parsing an
`Options` object from the `clap::ArgMatches` object.
2022-02-03 23:19:14 -05:00
Jeffrey Finkelstein
3fbaa79359
dd: add support for 'b' and 'x' multipliers
...
Support the suffix 'b' (multiply by 512) and 'x' (multiply by an
arbitrary amount) when specifying numeric arguments to dd.
2022-02-03 21:56:13 -05:00
snobee
f7e31f6008
stat: allow formatting of negative numbers
2022-02-03 16:01:19 -08:00
Hanif Ariffin
861437addf
Fix small clippy issue
...
Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
2022-02-03 21:45:02 +08:00
Hanif Bin Ariffin
3586465917
dont use is_numeric to check for digits
...
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.43262@gmail.com>
2022-02-03 21:42:22 +08:00
snobee
ee721ebf4e
head: handle multibyte numeric utf-8 chars
2022-02-03 21:42:22 +08:00
Hanif Ariffin
ff8a83b256
touch: Better error message when no args is given
...
Matches the behavior of GNU touch
```shell
hbina@akarin ~/g/uutils (hbina-realpath-absolute-symlinks)> touch > /dev/null
touch: missing file operand
Try 'touch --help' for more information.
hbina@akarin ~/g/uutils (hbina-realpath-absolute-symlinks) [1]> cargo run --quiet -- touch > /dev/null
touch: missing file operand
Try 'touch --help' for more information.
hbina@akarin ~/g/uutils (hbina-realpath-absolute-symlinks) [1]> cargo run --quiet -- touch 2> /dev/null
hbina@akarin ~/g/uutils (hbina-realpath-absolute-symlinks) [1]> touch 2> /dev/null
```
Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
2022-02-03 21:10:39 +08:00
Sylvestre Ledru
2d3b8db9ed
Merge pull request #3012 from shoriminimoe/2951-truncate
...
truncate: change cli error return code
2022-02-03 10:43:16 +01:00
Eli Youngs
d50c9c3e77
Fail when copying a directory to a file
2022-02-02 23:59:32 -08:00
Sylvestre Ledru
b411d91fac
Merge pull request #3014 from HeroicKatora/main
...
Make true return false less frequently
2022-02-02 21:43:21 +01:00
DevSaab
773ceb5534
Include ABOUT for shuf
2022-02-02 10:08:48 -05:00
Sylvestre Ledru
57231e6543
Merge pull request #3030 from rahulkadukar/hostid-description
...
hostid: added description in documentation
2022-02-02 10:29:26 +01:00
Sylvestre Ledru
64f3cd748d
Merge pull request #2976 from danieleades/lint
...
add additional lints
2022-02-02 09:55:57 +01:00
Eli Youngs
45751e9e48
cp: Create backup before hardlink
2022-02-01 23:49:39 -08:00
Ivan Majeru
9c73926616
Merge branch 'main' into dd-multi-status-options
2022-02-02 09:08:37 +02:00
Narasimha Prasanna HN
be6287e3e3
Fix: Avoid infinite recursive copies when source and destination directories are same or source is a prefix of destination
2022-02-02 11:17:53 +05:30
Rahul Kadukar
7e32b6ba17
Added description for hostid
2022-02-01 23:51:48 -05:00
Nathan
29b613a852
printf: resolve formatting nit in LONGHELP strings
...
Removed 1 preceeding space for LONGHELP_LEAD and 2 preceeding spaces for LONGHELP_BODY
2022-02-01 22:36:10 -05:00
Nathan
f6174dd946
printf: add description and version
...
Adds a version number and brief description to the printf utility in the user documentation
2022-02-01 19:28:39 -05:00
Sam Caldwell
39f8329222
truncate: use map_err
instead of unwrap_or_else
2022-02-01 14:13:52 -07:00
Rishi Kumar Ray
f117fd8dd6
added correct format to ABOUT
2022-02-02 02:40:59 +05:30
Terts Diepraam
87e582b5e0
Merge pull request #2977 from Dr-Emann/echo_octal_nul
...
echo: Allow echo with escapes to work with `\0`
2022-02-01 20:13:53 +01:00
Andreas Molzer
c6d5eccf6c
false,true: Resolve formatting nit in About
2022-02-01 19:53:25 +01:00
Ivan Majeru
19cc63df9a
dd: allow multiple instances of arguments
...
Correct the behavior of `dd` when multiple arguments are provided.
Before this commit, if the multiple arguments was provided then
the validation error are returned.
For example
```
$ printf '' | ./target/debug/dd status=none status=noxfer
error: The argument '--status=<LEVEL>' was provided more than once, but cannot be used multiple times
USAGE:
dd [OPTIONS]
For more information try --help
```
The unittest was added for this case.
2022-02-01 20:32:56 +02:00
Andreas Molzer
23a544c485
false,true: Implement custom help, version
...
This avoids hacking around the short options of these command line
arguments that have been introduced by clap. Additionally, we test and
correctly handle the combination of both version and help. The GNU
binary will ignore both arguments in this case while clap would perform
the first one. A test for this edge case was added.
2022-02-01 14:29:26 +01:00
Andreas Molzer
c1e108933f
false,true: Align behavior of short flags to GNU
2022-02-01 13:02:22 +01:00
Andreas Molzer
dcf177f908
false: Align behavior to true and GNU
2022-02-01 12:04:23 +01:00
Andreas Molzer
b29e219e4d
true: Rework to return true more often
...
Now treats recognized command line options and ignores unrecognized
command line options instead of returning a special exit status for
them.
There is one point of interest, which is related to an implementation
detail in GNU `true`. It may return a non-true exit status (in
particular EXIT_FAIL) if writing the diagnostics of a GNU specific
option fails. For example `true --version > /dev/full` would fail and
have exit status 1.
This behavior was acknowledged in gnu in commit
<9a6a486e6503520fd2581f2d3356b7149f1b225d>. No further
justification provided for keeping this quirk.
POSIX knows no such options, and requires an exit status of 0 in all
cases. We replicate GNU here which is a consistency improvement over the
prior implementation. Adds documentation to clarify the intended
behavior more properly.
2022-02-01 09:13:00 +01:00
Sam Caldwell
e1f7c774d8
Remove redundant import
2022-01-31 22:59:10 -07:00
Sam Caldwell
6f24166c63
[truncate] handle unused_must_use warning
2022-01-31 22:25:59 -07:00
Sam Caldwell
cd1b5c5748
[truncate] change cli error return code
...
Exit with status code 1 for argument parsing errors in `truncate`. When
`clap` encounters an error during argument parsing, it exits with status
code 2. This causes some GNU tests to fail since they expect status code
1.
2022-01-31 22:08:59 -07:00
Narasimha Prasanna HN
1194a8ce53
Fix: Update quick-error crate version from 1.2.3 to 2.0.1 in src/uu/cp ( #2947 )
...
fix: update quick-error crate from 1.2.3 to 2.0.1 for src/uu/cp tool, fixes: #2941
2022-01-31 21:56:47 +01:00
Terts Diepraam
7fc82cd376
Merge pull request #2902 from jtracey/join-non-unicode-sep
...
join: add support for non-unicode field separators
2022-01-31 21:54:56 +01:00
Terts Diepraam
7477761428
Merge pull request #2882 from jtracey/join-bigfields-compat
...
join: "support" field numbers larger than usize::MAX
2022-01-31 21:52:13 +01:00
Daniel Eades
4f8d1c5fcf
add additional lints
2022-01-31 20:40:47 +01:00
Sylvestre Ledru
dfc661e8b5
Merge pull request #2975 from douglaz/sha_update
...
Updated sha libraries
2022-01-31 08:26:49 +01:00
Zachary Dremann
ad4c5d3357
paste: Use a single buffer
2022-01-30 23:01:15 -05:00
Zachary Dremann
85a81d328a
paste: Create vec with capacity
2022-01-30 23:01:11 -05:00
Zachary Dremann
ff14f25c34
paste: Reuse output
allocation
2022-01-30 23:01:05 -05:00
Zachary Dremann
8905d52279
paste: Write to a locked stdout
2022-01-30 23:01:01 -05:00
Zachary Dremann
c6ec4f8f17
paste: Store delimiters as chars, rather than strings
2022-01-30 23:00:56 -05:00
Zachary Dremann
fa44957a63
paste: Handle unicode delimiters
2022-01-30 23:00:49 -05:00
Jeffrey Finkelstein
b9c2066ee9
uucore: move lines.rs to be a uucore feature
...
Refactor the `lines.rs` module to be a feature in `uucore`. It was
common to both `head` and `tail`.
2022-01-30 22:15:35 -05:00
Jeffrey Finkelstein
cba0696b90
head: don't add trailing newline to end of file
...
Prevent `head` from adding a trailing newline to the end of a file
that did not originally have one when using `head --lines=-0`.
2022-01-30 22:04:19 -05:00
Jeffrey Finkelstein
371278e043
truncate: fix typo in docs: "the any" -> "any"
2022-01-30 22:03:13 -05:00
Jeffrey Finkelstein
fe5b537f56
truncate: error when trying to truncate a fifo
...
Terminate the `truncate` program with an error message when trying to
truncate a named pipe (also known as a fifo).
2022-01-30 22:03:12 -05:00
Jeffrey Finkelstein
83eac9c0a8
head: incorporate "all but last" option into Mode
...
Refactor the `Mode` enum in the `head.rs` module so that it includes
not only the mode type---lines or bytes---but also whether to read the
first NUM items of that type or all but the last NUM. Before this
commit, these two pieces of information were stored separately. This
made it difficult to read the code through several function calls and
understand at a glance which strategy was being employed.
2022-01-30 22:01:25 -05:00
Justin Tracey
58d65fb953
join: add support for non-unicode field separators
...
This allows for `-t` to take invalid unicode (but still single-byte) values
on unix-like platforms. Other platforms, which as of the time of this commit
do not support `OsStr::as_bytes()`, could possibly be supported in the future,
but would require design decisions as to what that means.
2022-01-30 20:04:22 -05:00
Zachary Dremann
d6a0b3c920
Allow echo with escapes to work with \0
...
Testing with gecho on macos outputs a nul character for a \0
2022-01-30 17:24:29 -05:00
Terts Diepraam
7b3cfcf708
Merge pull request #2868 from jfinkels/split-filename-iterator
...
split: use iterator to produce filenames
2022-01-30 22:37:37 +01:00
Allan Douglas R. de Oliveira
f22051a4e1
Updated sha libraries
2022-01-30 17:23:02 -03:00
Daniel Eades
41e2197188
squash some repeated match blocks
2022-01-30 18:32:09 +01:00
Sylvestre Ledru
de07df5992
Merge pull request #2963 from danieleades/refactor/code-quality
...
Refactor/code quality
2022-01-30 18:26:16 +01:00
Jeffrey Finkelstein
a5b435da58
split: use iterator to produce filenames
...
Replace the `FilenameFactory` with `FilenameIterator` and calls to
`FilenameFactory::make()` with calls to `FilenameIterator::next()`. We
did not need the fully generality of being able to produce the
filename for an arbitrary chunk index. Instead we need only iterate
over filenames one after another. This allows for a less
mathematically dense algorithm that is easier to understand and
maintain. Furthermore, it can be connected to some familiar concepts
from the representation of numbers as a sequence of digits.
This does not change the behavior of the `split` program, just the
implementation of how filenames are produced.
Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
2022-01-30 11:18:58 -05:00
Daniel Eades
ba45fe312a
use 'Self' and derive 'Default' where possible
2022-01-30 15:08:26 +01:00
Daniel Eades
2f85610cc3
remove explicit iter loops
2022-01-30 15:08:26 +01:00
Daniel Eades
cf24620d3d
remove 'let and return'
2022-01-30 15:08:26 +01:00
Daniel Eades
784f2e2ea1
use semicolons if nothing returned
2022-01-30 15:08:26 +01:00
Daniel Eades
a2d5f06be4
remove needless pass by value
2022-01-30 15:08:26 +01:00
Daniel Eades
8bb6c4effa
use pointer args
2022-01-30 14:01:21 +01:00
Daniel Eades
f2074140ec
use 'char' instead of 'str' for single character patterns
2022-01-30 14:01:21 +01:00
Daniel Eades
5af66753af
remove needless borrows
2022-01-30 14:01:21 +01:00
Sylvestre Ledru
2f6f6867c5
Merge branch 'main' into 2940
2022-01-30 13:33:35 +01:00
Sylvestre Ledru
57dc11e586
Merge pull request #2871 from jfinkels/split-settings-methods
...
split: add a method to convert ArgMatches to Settings
2022-01-30 11:31:58 +01:00
Sylvestre Ledru
81b2a240e6
Merge pull request #2960 from water-ghosts/fix-cp-a-panic
...
Don't panic when calling cp -a with a nonexistent file
2022-01-30 11:30:56 +01:00
Sylvestre Ledru
bfa2d8b7da
Merge pull request #2875 from kimono-koans/ls_bad_fd_2
...
ls: Fix display of bad file descriptor errors
2022-01-30 09:59:58 +01:00
Sylvestre Ledru
7c1abdb7d9
Merge pull request #2866 from jfinkels/split-number-2
...
split: implement -n option
2022-01-30 09:58:04 +01:00
Sylvestre Ledru
b8b642101f
Merge pull request #2898 from jfinkels/tail-lines-zero-terminated
...
tail: support zero-terminated lines in streams
2022-01-30 09:44:04 +01:00
Eli Youngs
680e9081fe
Don't panic when calling cp -a with a nonexistent file
2022-01-29 22:59:53 -08:00
Dan Klose
bb7f37e8b4
fix: update itertools 0.8.0 -> 0.10.0
...
Targets https://github.com/uutils/coreutils/issues/2940
* since versions were mxing versions of x.y and x.y.z I changed all to x.y.z
* minor whitespace formatting
2022-01-29 22:35:51 +00:00
Terts Diepraam
eb82015b23
all: change macros
...
- Change the main! proc_macro to a bin! macro_rules macro.
- Reexport uucore_procs from uucore
- Make utils to not import uucore_procs directly
- Remove the `syn` dependency and don't parse proc_macro input (hopefully for faster compile times)
2022-01-29 15:26:32 +01:00
Sylvestre Ledru
1dcd3b2c24
Merge pull request #2943 from jfinkels/truncate-no-such-dir
...
truncate: better error msg when dir does not exist
2022-01-29 12:25:38 +01:00
Sylvestre Ledru
52ab6325a0
Merge pull request #2881 from jtracey/join-null-field-sep
...
join: add support for `-t '\0'`
2022-01-29 10:55:04 +01:00
Sylvestre Ledru
196a7a921c
Merge pull request #2877 from jfinkels/head-use-uucore-error-handling
...
head: use uucore error handling instead of custom
2022-01-29 10:53:48 +01:00
Sylvestre Ledru
24744ca42b
Merge pull request #2911 from jfinkels/dd-seek-stdout
...
dd: support seek=N when destination is stdout
2022-01-29 10:47:17 +01:00
Sylvestre Ledru
57ee6b5302
Merge branch 'main' into truncate-no-such-dir
2022-01-29 09:58:17 +01:00
Sylvestre Ledru
cbc7da3d7d
Merge pull request #2936 from tertsdiepraam/clap-infer-long-args
...
all: enable infer long arguments in clap
2022-01-29 09:57:15 +01:00
Sylvestre Ledru
bd44c59043
Merge pull request #2945 from jfinkels/truncate-reduce-underflow
...
truncate: prevent underflow when reducing size
2022-01-29 09:55:29 +01:00
Sylvestre Ledru
52b7a725ed
Merge pull request #2938 from sylvestre/selinux-dep
...
selinux: add consistency in the dep declaration
2022-01-29 09:46:16 +01:00
Jeffrey Finkelstein
0454d3b243
truncate: prevent underflow when reducing size
...
Prevent usize underflow when reducing the size of a file by more than
its current size. For example, if `f` is a file with 3 bytes, then
truncate -s-5 f
will now set the size of the file to 0 instead of causing a panic.
2022-01-28 22:44:07 -05:00
Jeffrey Finkelstein
c780c96e17
truncate: better error msg when dir does not exist
...
Improve the error message that gets printed when a directory does not
exist. After this commit, the error message is
truncate: cannot open '{file}' for writing: No such file or directory
where `{file}` is the name of a file in a directory that does not
exist.
2022-01-28 21:21:37 -05:00
Terts Diepraam
5f1933a89f
df: no longer override help
2022-01-29 02:06:32 +01:00
Terts Diepraam
9c8e865b55
all: enable infer long arguments in clap
2022-01-29 02:06:29 +01:00
Sylvestre Ledru
96584027e5
selinux: add consistency in the dep declaration
2022-01-29 01:31:17 +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
b94bd96bc6
ignore spelling issue
2022-01-29 00:35:16 +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
electricboogie
72c53219e3
Prevent potential unwrap on a None value
2022-01-27 22:07:07 -06: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
b636ff04a0
split: implement -n option
...
Implement the `-n` command-line option to `split`, which splits a file
into a specified number of chunks by byte.
2022-01-27 21:16: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
electricboogie
5e82d6069f
Fix comments
2022-01-27 16:12:34 -06: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
electricboogie
463c1ac2ff
Make suggested changes: Move logic into PathData struct, etc.
2022-01-27 11:57:19 -06:00
electricboogie
7512200ba2
Cleanup comments
2022-01-26 16:52:05 -06:00
electricboogie
1d629d8d66
Move more logic into md function, make enter_directory function clearer
2022-01-26 16:41:52 -06: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
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
Jeffrey Finkelstein
e8df666c2e
dd: support seek=N when destination is stdout
...
Add support for the `seek=N` argument when the destination is stdout
and not a file. Previously, the argument was ignored when writing to
stdout.
2022-01-25 12:34:13 -05: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
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
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
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
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
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
Terts Diepraam
7014607f0a
Merge branch 'main' into mdbook
2022-01-22 12:42:19 +01:00
Jeffrey Finkelstein
f595edaded
tail: fix a bug in tail [ -n | -c ] +NUM <file>
...
Fix a bug when getting all but the first NUM lines or bytes of a file
via `tail -n +NUM <file>` or `tail -c +NUM <file>`. The bug only
existed when a file is given as an argument; it did not exist when the
input data came from stdin.
2022-01-21 19:05:53 -05:00
Jeffrey Finkelstein
d27d6bc32c
split: add forwards_thru_file() helper function
...
Add helper function `forwards_thru_file()` that finds the index in a
reader of the byte immediately following the `n`th instance of a given
byte.
2022-01-21 18:33:15 -05:00
Jeffrey Finkelstein
58d84d5107
tail: support zero-terminated lines in streams
...
Support `-z` option when the input is not a seekable file. Previously,
the option was accepted by the argument parser, but it was being
ignored by the application logic.
2022-01-21 18:31:15 -05:00
Sylvestre Ledru
8c298e97a5
expr: Fix a warning in the doc generation ( #2900 )
...
```
warning: this URL is not a hyperlink
```
2022-01-21 23:14:05 +01:00
Terts Diepraam
ab3623f65a
docs: usage and values for options
2022-01-21 19:20:55 +01:00
Cecylia Bocovich
67878de379
join: print unsorted line in error message
...
This expands the error message that is printed if either input file has
an unsorted line. Both the program name (join) and the offending line
are printed out with the message to match the behaviour of the GNU
utility.
2022-01-21 11:47:37 -05:00
Terts Diepraam
9ddd61ab6b
Merge branch 'main' into hbina-tr-reimplement-expansion
2022-01-21 14:42:30 +01:00
Terts Diepraam
55a47f6fc0
Merge pull request #2863 from tertsdiepraam/clap-3
...
Clap 3
2022-01-20 23:14:52 +01:00
Sylvestre Ledru
d64b32d121
Merge pull request #2885 from jfinkels/head-find-nth-line-from-end
...
head: refactor helper function find_nth_line_from_end()
2022-01-20 21:53:47 +01:00
electricboogie
0b53cd8c4a
Make suggested changes
2022-01-20 14:52:45 -06:00
Terts Diepraam
b51a6e8fe3
tr: make parsing of sets more terse
2022-01-19 21:03:57 +01:00
Terts Diepraam
da728dd2b6
Merge branch 'main' into hbina-tr-reimplement-expansion
2022-01-19 19:34:13 +01:00
Terts Diepraam
6aa433c70a
tr: adapt copyright to new guidelines
2022-01-19 19:07:17 +01:00
Roy Ivy III
2e251f91f1
0.0.12
2022-01-19 05:35:00 -06:00
Jeffrey Finkelstein
ca812a7558
tail: rm trailing \n if input doesn't end with one
...
Fix a bug where `tail` would inappropriately add a newline to the last
line of output even though the input did not end with one.
2022-01-18 17:34:41 -05:00
Terts Diepraam
4b79419514
runcon/hashsum: remove references to get_matches_from_safe
2022-01-18 16:34:06 +01:00
Terts Diepraam
0a30c43bb6
chcon: use try_get_matches_from
2022-01-18 13:06:02 +01:00
Terts Diepraam
e345768484
base64: remove clap dependency again
2022-01-18 12:56:58 +01:00
Terts Diepraam
270a6ee83e
rm: fix 3 leading hyphens for ---presume-input-tty
2022-01-18 12:54:50 +01:00
Justin Tracey
ce3df12eaa
join: "support" field numbers larger than usize::MAX
...
They silently get folded to usize::MAX, which is the official GNU behavior.
2022-01-17 17:49:41 -05:00
Jeffrey Finkelstein
e575007629
tail: improve error handling when file not found
2022-01-17 10:57:24 -05:00
Jeffrey Finkelstein
0f1053ce68
head: refactor helper func find_nth_line_from_end
...
Factor out a loop for finding the index of the byte immediately
following the `n`th line from the end of a file. This does not change
the behavior of the code, just its organization.
2022-01-17 10:55:40 -05:00
Terts Diepraam
951f3bb689
fix up runcon and chcon for clap 3
2022-01-17 16:52:17 +01:00
Terts Diepraam
55893f0e3d
od: use clap options instead of custom mock options for unit tests
2022-01-17 16:25:49 +01:00
sbentmar
b0cf6f9b34
numfmt: minor adjustments to test cases
2022-01-17 16:24:40 +01:00
sbentmar
635c2d0c31
numfmt: remove unused function
2022-01-17 16:24:40 +01:00
sbentmar
1287ce3780
numfmt: add tests for handle_buffer
2022-01-17 16:24:40 +01:00
sbentmar
4a7d313712
numfmt: add unit test for io error
2022-01-17 16:24:40 +01:00
sbentmar
5cab4e41b3
numfmt: add copyright notice
2022-01-17 16:24:40 +01:00
Sebastian Holgersson
9b04c98ddb
numfmt: use UResult in more functions
...
This commit replaces generic Results with UResults in some key
functions in numfmt. As a result of this, we can provide different
exit codes for different errors, which resolves ~70 failing test
cases in the GNU numfmt.pl test suite.
2022-01-17 16:24:40 +01:00
Jeffrey Finkelstein
ab4036297b
head: use uucore error handling instead of custom
...
Use `show!()` and `USimpleError` to handle I/O errors instead of using
custom code.
2022-01-17 08:58:44 -05:00
Jeffrey Finkelstein
58f2000406
split: method to convert ArgMatches to Settings
...
Create a `Settings::from` method that converts a `clap::ArgMatches`
instance into a `Settings` instance. This eliminates the unnecessary
use of a mutable variable when initializing the settings.
2022-01-17 08:58:10 -05:00
Jeffrey Finkelstein
d9afdf0527
uucore: move printf::memo module to uucore
...
Move the `printf::memo` module to `uucore` so that it can be used by
other programs, not just `printf`. For example, the `-f` option to `seq`
requires parsing and formatting numbers according to the same logic as
`printf`.
2022-01-17 08:46:45 -05:00
Jeffrey Finkelstein
2d66c84413
printf: remove cli module
...
Remove the cli module from the printf crate and move its functions into
the module tokenize::unescaped_text module, the only place they are
used.
2022-01-17 08:43:36 -05:00
Terts Diepraam
8872485922
Merge branch 'main' into clap-3
2022-01-17 13:25:51 +01:00
Terts Diepraam
08efa1fe5a
Merge branch 'main' into join-null-field-sep
2022-01-17 12:59:52 +01:00
Sylvestre Ledru
a87a71893f
Merge pull request #2879 from sylvestre/chrono-issue
...
Force minimal version of chrono to avoid a security issue
2022-01-17 12:53:31 +01:00
Justin Tracey
109277d405
join: add support for -t '\0'
2022-01-16 18:05:58 -05:00
Justin Tracey
346415e1d2
join: add support for -z option
2022-01-16 17:56:07 -05:00
Sylvestre Ledru
fcff6fec6d
Force minimal version of chrono to avoid a security issue
...
See: https://rustsec.org/advisories/RUSTSEC-2020-0071.html
2022-01-16 23:33:12 +01:00
Sylvestre Ledru
4fc47aba61
Merge pull request #2878 from tertsdiepraam/stdbuf-trouble
...
`stdbuf`: fix `cargo publish` problem
2022-01-16 23:23:35 +01:00
Sylvestre Ledru
516bdfcfd5
Merge pull request #2872 from jfinkels/split-verbose
...
split: add --verbose option
2022-01-16 23:19:30 +01:00
Terts Diepraam
c5e2515833
fix stdbuf problem
2022-01-16 22:50:34 +01:00
electricboogie
16b7b38b92
Run cargo fmt
2022-01-16 11:17:43 -06:00
electricboogie
e6ce049d2c
Fix Windows lints/build errors
2022-01-16 11:07:22 -06:00
electricboogie
e1bffea595
Merge branch 'master' into ls_bad_fd_2
2022-01-16 10:26:44 -06:00
electricboogie
15efba54c5
Use dir_entry metadata for dereferenced bad fds to match GNU, add comments, clippy lints
2022-01-16 10:20:50 -06:00
Sylvestre Ledru
1fbda8003c
coreutils 0.0.8 => 0.0.9, uucore_procs 0.0.7 => 0.0.8, uucore 0.0.10 => 0.0.11
2022-01-16 17:05:48 +01:00
Sylvestre Ledru
00c11b184f
Merge pull request #2851 from jtracey/join-strless
...
join: operate on bytes instead of Strings
2022-01-16 16:24:38 +01:00
Terts Diepraam
448b84806f
fix Rust 1.58 clippy lints ( #2874 )
2022-01-16 15:57:33 +01:00
Jeffrey Finkelstein
7af3007204
split: add --verbose option
2022-01-16 09:34:28 -05:00
electricboogie
37ca6edfdc
Fix display of bad fd errors
2022-01-15 22:39:07 -06:00
kimono-koans
fd5310411e
ls: Fix device display ( #2855 )
2022-01-15 00:39:56 +01:00
Sylvestre Ledru
3cc1fb593a
Merge pull request #2859 from jfinkels/split-dynamic-suffix-length
...
split: correct filename creation algorithm
2022-01-14 18:06:57 +01:00
Terts Diepraam
49e5412580
tsort: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
e62fdb9307
yes: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
fe69ad25f8
whoami: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
e3b8e6c993
who: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
e9e5768591
wc: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
e5a775be46
users: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
ac76eefb99
uptime: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
2cd32beb70
unlink
2022-01-11 19:16:48 +01:00
Terts Diepraam
5105a59fda
uniq: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
dafa0737c8
unexpand: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
7de993fa4f
uname: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
48c65934c7
tty: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
263357666f
truncate: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
6c37cdebce
true: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
fd777866a3
tr: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
9f58715d65
touch: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
7318d1d24b
timeout: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
0ff1984471
test: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
3cac8a631f
tee: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
9c9643807a
tail: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
219498c2e8
tac: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
57361292aa
sync: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
bad790840a
sum: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
0fca4460de
stdbuf: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
eaaa16291e
stat: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
ecf6f18ab3
split: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
b43839a8a8
sort: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
d0a52c95e6
sleep: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
793e540323
shuf: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
92e94de2d7
shred: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
41513a8ba6
seq: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
ec42e824f0
runcon: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
4edab26dcc
pr: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
f260f60093
rmdir: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
283973c5bf
rm: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
a02e40fcad
relpath: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
d52887e6c0
pwd: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
edafc468ed
realpath: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
d8f2be2f3b
readlink: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
24dc4d9037
ptx: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
b94809197f
printf: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
8ba10936b0
printenv: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
c39a9b49d4
pinky: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
49b19972cc
pathchk: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
8f7f3d18ee
paste: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
9efd6654f8
od: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
7cebb2563b
numfmt: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
5702313e9c
nproc: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
5e9443567d
nohup: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
5b13ec9c66
nl: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
64f57a9200
nice: clap 3
2022-01-11 19:16:48 +01:00
Terts Diepraam
ba93684a7e
mv: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
41d567f44b
more: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
f902ec7d6e
mktemp: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
6e39eddbc1
mknod: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
c8eddad610
mkfifo: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
0e021e956a
mkdir: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
c8270b202e
ls: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
ebaf5caae8
logname: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
9951958b93
ln: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
0531f13cfd
link: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
83f39619d5
kill: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
b61494337e
join: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
89112fb1c2
install: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
8c58f8e2b1
id: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
82aadbf38f
hostname: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
6876521b08
hostid: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
9fc9fdb1f3
head: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
6e34d8a53c
hashsum: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
742fe8500c
groups: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
ebe96f1454
fold: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
e3e35cb1a9
fmt: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
df5bf0c2a4
false: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
b5ba2fc5ca
factor: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
55eb4a271b
expr: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
449a536c59
expand: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
4d917e28b2
env: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
812f2db464
echo: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
1f2c3064b8
du: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
db1e630c6c
dirname: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
9bd1c3e967
dircolors: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
739217968f
df: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
11bfb5c73f
dd: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
f5797275b7
date: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
7a0309a5aa
cut: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
88447c2e50
csplit: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
37ab05bd7a
cp: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
99a3dc324c
comm: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
cf78121746
cksum: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
16afe58371
chroot: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
8261cf05f3
chown: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
2576615576
chmod: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
e4acb64880
chgrp: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
f35b132f67
chcon: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
048cfaf97f
cat: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
fb1f9ecf80
basenc: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
7e9529b8b8
arch: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
031bde97bf
base32: clap 3
2022-01-11 19:16:47 +01:00
Terts Diepraam
0fb7ceb1a0
base64: remove clap dependency (handled by base_common)
2022-01-11 19:06:36 +01:00
Terts Diepraam
67e5ede0a1
basename: clap 3
2022-01-11 19:06:36 +01:00
Sylvestre Ledru
6723a54610
Merge pull request #2862 from rivy/fix.whitespace
...
refactor/polish ~ whitespace fixup
2022-01-11 17:51:37 +01:00
kimono-koans
016d5e72ad
ls: Fix padding for dangling links in non-Long formats ( #2856 )
...
* Fix padding for dangling links in non-long formats
Co-authored-by: electricboogie <32370782+electricboogie@users.noreply.github.com>
2022-01-11 12:01:54 +01:00
Jeffrey Finkelstein
cfe5a0d82c
split: correct filename creation algorithm
...
Fix two issues with the filename creation algorithm. First, this
corrects the behavior of the `-a` option. This commit ensures a
failure occurs when the number of chunks exceeds the number of
filenames representable with the specified fixed width:
$ printf "%0.sa" {1..11} | split -d -b 1 -a 1
split: output file suffixes exhausted
Second, this corrects the behavior of the default behavior when `-a`
is not specified on the command line. Previously, it was always
settings the filenames to have length 2 suffixes. This commit corrects
the behavior to follow the algorithm implied by GNU split, where the
filename lengths grow dynamically by two characters once the number of
chunks grows sufficiently large:
$ printf "%0.sa" {1..91} | ./target/debug/coreutils split -d -b 1 \
> && ls x* | tail
x81
x82
x83
x84
x85
x86
x87
x88
x89
x9000
2022-01-10 20:43:22 -05:00
Jeffrey Finkelstein
e5d6b7a1cf
split: correct arg parameters for -b option
2022-01-10 20:43:22 -05:00
Terts Diepraam
f60c36f242
Merge pull request #2610 from miDeb/cp/abuse
...
cp: handle edge cases when dest is a symlink
2022-01-11 00:34:55 +01:00
Roy Ivy III
7a760cae99
refactor/polish ~ re-normalize whitespace
...
* minimize inconsistent/invisible whitespace
- consistent indentation (either spaces-only, tabs, *or* tabs with following spaces [for indentation])
- no internal/invisible tabs
- no trailing whitespace
- EOF EOLNs
2022-01-09 21:35:39 -06:00
Roy Ivy III
d6b93e42c9
update ~ pin 'retain_mut' to v0.1.2 (with MinSRV maint ToDO)
...
- v0.1.5 uses const generics which aren't stable until rust v1.51.0
2022-01-09 18:57:25 -06:00
Roy Ivy III
774e72551b
change ~ relax 'nix' version and remove 'nix' patch
...
- code coverage compilation on MacOS latest (MacOS-11+) now works with newer 'nix' versions
2022-01-09 18:57:25 -06:00
Sylvestre Ledru
dcfdeb334d
Merge pull request #2854 from kimono-koans/ls_fix_errno_1
...
ls: Fix Errno 1, print errors at the md call point
2022-01-09 20:56:06 +01:00
moko256
5659bf8fae
ls: On Windows use DirEntry#metadata() instead of fs::metadata
2022-01-10 02:56:22 +09:00
Sylvestre Ledru
63ef039b4f
Merge pull request #2826 from jfinkels/stdbuf-uresult
...
stdbuf: return UResult from uumain() function
2022-01-08 22:34:06 +01:00
Sylvestre Ledru
6637fba988
Merge pull request #2833 from jfinkels/tr-uresult
...
tr: return UResult from uumain() function
2022-01-08 22:30:43 +01:00
Sylvestre Ledru
a007ef2c1a
Merge pull request #2834 from jfinkels/truncate-uresult
...
truncate: return UResult from uumain() function
2022-01-08 22:29:57 +01:00
kimono-koans
4ea61545c6
Merge branch 'uutils:master' into ls_fix_errno_1
2022-01-07 21:48:53 -06:00
Sylvestre Ledru
9922e48ba6
Merge pull request #2853 from kimono-koans/ls_fix_first_newline
...
ls: Fix newline when only dirs in base directory
2022-01-07 23:10:44 +01:00
Sylvestre Ledru
c9d982fb4d
Merge pull request #2848 from jfinkels/realpath-uresult
...
realpath: return UResult from uumain() function
2022-01-07 21:51:57 +01:00
Sylvestre Ledru
5f778ffa2e
Merge pull request #2847 from jfinkels/pr-uresult
...
pr: return UResult from uumain() function
2022-01-07 21:51:41 +01:00
Sylvestre Ledru
480bd3c36a
Merge pull request #2835 from jfinkels/tsort-uresult
...
tsort: return UResult from uumain() function
2022-01-07 21:51:25 +01:00
Sylvestre Ledru
0f4b0fd9cd
Merge pull request #2832 from jfinkels/timeout-uresult
...
timeout: return UResult from uumain() function
2022-01-07 21:51:01 +01:00
Sylvestre Ledru
3f27597fca
Merge pull request #2823 from jfinkels/split-uresult
...
split: return UResult from uumain() function
2022-01-07 21:49:11 +01:00
Sylvestre Ledru
c14ba865ce
Merge pull request #2821 from jfinkels/runcon-uresult
...
runcon: return UResult from uumain() function
2022-01-07 21:47:51 +01:00
Sylvestre Ledru
969f3cbf39
Merge pull request #2793 from tertsdiepraam/cksum-result-io-error
...
`cksum`: use `UIoError`
2022-01-07 21:47:01 +01:00
electricboogie
01585a57f6
Fix Errno 1, print errors at the md call point
2022-01-07 00:38:24 -06:00
electricboogie
30b2425541
Fix newline when only dirs in base directory, and test
2022-01-06 14:58:56 -06:00
Justin Tracey
9ad8a03646
join: operate on bytes instead of Strings
2022-01-05 13:24:10 -05:00
kimono-koans
421330d07a
ls: Improve error handling and other improvements ( #2809 )
...
* print error in the correct order by flushing the stdout buffer before printing an error
* print correct GNU error codes
* correct formatting for config.inode, and for dangling links
* correct padding for Format::Long
* remove colors after the -> link symbol as this doesn't match GNU
* correct the major, minor #s for char devices, and correct padding
* improve speed for all metadata intensive ops by not allocating metadata unless in a Sort mode
* new tests, have struggled with how to deal with stderr, stdout ordering in a test though
* tried to implement UIoError, but am still having issues matching the formatting of GNU
Co-authored-by: electricboogie <32370782+electricboogie@users.noreply.github.com>
2022-01-05 14:50:37 +01:00
Sylvestre Ledru
ae7190ec73
Merge pull request #2846 from jfinkels/wc-uresult
...
wc: return UResult from uumain() function
2022-01-05 14:39:39 +01:00
Sylvestre Ledru
64effa5e78
Merge branch 'master' into split-uresult
2022-01-05 13:51:48 +01:00
Sylvestre Ledru
8ef2ea1356
Merge pull request #2830 from jfinkels/tee-uresult
...
tee: return UResult from uumain() function
2022-01-05 13:51:05 +01:00
Jeffrey Finkelstein
b30a20d895
chcon: return UResult from uumain() function
2022-01-02 20:08:11 -05:00
Jeffrey Finkelstein
49dca9adcb
realpath: return UResult from uumain() function
2022-01-02 19:59:15 -05:00
Jeffrey Finkelstein
c80e44fb08
pr: return UResult from uumain() function
2022-01-02 19:48:52 -05:00
Jeffrey Finkelstein
cb92db322b
timeout: return UResult from uumain() function
2022-01-02 19:41:21 -05:00
Jeffrey Finkelstein
9caf15c44f
fixup! wc: return UResult from uumain() function
2022-01-02 19:40:22 -05:00
Sylvestre Ledru
cd1a0fbe36
Merge pull request #2841 from sbentmar/add-suffix-to-numfmt
...
numfmt: implement missing --suffix option
2022-01-02 23:07:29 +01:00
Sylvestre Ledru
3c68988ae7
Merge pull request #2843 from tertsdiepraam/stdbuf/fix-cargo-git-build
...
stdbuf: fix cargo --git build (#1276 ) (Attempt 2)
2022-01-02 23:06:59 +01:00
Sylvestre Ledru
e7dd56c1d5
Merge pull request #2845 from jfinkels/unexpand-uresult
...
unexpand: return UResult from uumain() function
2022-01-02 19:02:30 +01:00
Jeffrey Finkelstein
e060ac53f2
wc: return UResult from uumain() function
2022-01-02 11:15:30 -05:00
Jeffrey Finkelstein
f89dc6585d
unexpand: return UResult from uumain() function
2022-01-02 10:33:41 -05:00
Jeffrey Finkelstein
b7e646e710
tty: return UResult from uumain() function
2022-01-02 10:28:53 -05:00
Terts Diepraam
ebd5e965e9
stdbuf: fix cargo --git build ( #1276 )
2022-01-02 14:17:05 +01:00
Sebastian Holgersson
a3895bba59
numfmt: replace if let with simpler match
2022-01-02 02:16:59 +01:00
Sylvestre Ledru
406cd887e0
Merge pull request #2828 from jfinkels/sum-uresult
...
sum: return UResult from uumain() function
2022-01-01 22:37:01 +01:00
Sylvestre Ledru
8673fbaa03
Merge pull request #2829 from jfinkels/sync-uresult
...
sync: return UResult from uumain() function
2022-01-01 22:36:11 +01:00
Sylvestre Ledru
46767952ce
Merge pull request #2831 from jfinkels/test-uresult
...
test: return UResult from uumain() function
2022-01-01 22:35:51 +01:00
Sebastian Holgersson
af5919e466
numfmt: implement missing --suffix option
...
adds support for the --suffix option from issue #1280 .
2022-01-01 21:57:23 +01:00
Terts Diepraam
7fa720d311
fix lint, fmt & udeps errors
2022-01-01 19:43:44 +01:00
Terts Diepraam
62341112df
remove cut-specific macros
2022-01-01 18:50:34 +01:00
Terts Diepraam
c075f105a4
remove unnecessary and unused macros
2022-01-01 18:31:47 +01:00
Jeffrey Finkelstein
d03dcc0231
test: return UResult from uumain() function
2021-12-31 18:25:26 -05:00
Jeffrey Finkelstein
3339060ece
tsort: return UResult from uumain() function
2021-12-31 14:57:00 -05:00
Jeffrey Finkelstein
c23a844c1e
truncate: return UResult from uumain() function
2021-12-31 14:50:52 -05:00
Jeffrey Finkelstein
21c1d832ae
tr: return UResult from uumain() function
2021-12-31 14:44:57 -05:00
Jeffrey Finkelstein
1ead016f35
fixup! sync: return UResult from uumain() function
2021-12-31 14:28:27 -05:00
Jeffrey Finkelstein
28958a3ed2
tee: return UResult from uumain() function
2021-12-31 14:07:39 -05:00
Jeffrey Finkelstein
4e16717c22
sync: return UResult from uumain() function
2021-12-31 13:59:20 -05:00
Jeffrey Finkelstein
29d7103670
sum: return UResult from uumain() function
2021-12-31 13:53:56 -05:00
Jeffrey Finkelstein
df188258ec
stdbuf: return UResult from uumain() function
2021-12-31 12:23:45 -05:00
Jeffrey Finkelstein
1f937b0760
split: return UResult from uumain() function
2021-12-31 12:19:36 -05:00
Jeffrey Finkelstein
b5522e1132
runcon: return UResult from uumain() function
2021-12-31 12:12:13 -05:00
Sylvestre Ledru
cb051e7416
Merge pull request #2825 from jfinkels/stat-uresult
...
stat: return UResult from uumain() function
2021-12-31 11:06:02 +01:00
Sylvestre Ledru
e3ba10cf1f
Merge pull request #2824 from jfinkels/split-strategy-enum
...
split: replace string checking with Strategy enum
2021-12-31 10:44:49 +01:00
Sylvestre Ledru
3e97de6946
Merge pull request #2820 from jfinkels/rm-uresult
...
rm: return UResult from uumain() function
2021-12-31 10:43:47 +01:00
Sylvestre Ledru
a99ce6f3f0
Merge pull request #2819 from jfinkels/relpath-uresult
...
relpath: return UResult from uumain() function
2021-12-31 10:43:21 +01:00
Sylvestre Ledru
60f501bab3
Merge pull request #2818 from jfinkels/readlink-uresult
...
readlink: return UResult from uumain() function
2021-12-31 10:43:09 +01:00
Sylvestre Ledru
e08f94ca28
Merge pull request #2817 from jfinkels/ptx-uresult
...
ptx: return UResult from uumain() function
2021-12-31 10:42:45 +01:00
Jeffrey Finkelstein
a862fdd60b
stat: return UResult from uumain() function
2021-12-30 22:39:23 -05:00
Jeffrey Finkelstein
8f04613a84
split: create Strategy enum for chunking strategy
2021-12-30 22:18:17 -05:00
Jeffrey Finkelstein
25d0ccc61d
split: move parsing outside of *Splitter::new()
...
Move the parsing of the output chunk size from inside
`ByteSplitter::new()` and `LineSplitter::new()` to outside. This
eliminates duplicate code and reduces the responsibilities of the
`ByteSplitter` and `LineSplitter` implementations.
2021-12-30 22:17:26 -05:00
Jeffrey Finkelstein
75e742a008
split: correct help text for -l option
2021-12-30 22:17:20 -05:00
Sylvestre Ledru
9f21cd0d37
Merge pull request #2822 from jfinkels/shred-uresult
...
shred: return UResult from uumain() function
2021-12-30 09:51:51 +01:00
Jeffrey Finkelstein
e9093681a5
shred: return UResult from uumain() function
2021-12-29 20:33:04 -05:00
Sylvestre Ledru
a8457bfad6
Merge pull request #2798 from jfinkels/fmt-uresult
...
fmt: return UResult from uumain() function
2021-12-29 21:59:50 +01:00
Jeffrey Finkelstein
f6305e2a3e
rm: return UResult from uumain() function
2021-12-29 15:57:55 -05:00
Jeffrey Finkelstein
ab495427b4
relpath: return UResult from uumain() function
2021-12-29 15:49:30 -05:00
Jeffrey Finkelstein
980708cdee
readlink: return UResult from uumain() function
2021-12-29 14:44:22 -05:00
Jeffrey Finkelstein
2a7831bd94
readlink: eliminate duplicate code
2021-12-29 14:42:00 -05:00
Jeffrey Finkelstein
da198e5469
ptx: return UResult from uumain() function
2021-12-29 14:28:45 -05:00
Terts Diepraam
4ae838a8b2
Merge pull request #2786 from E3uka/cut_uresult
...
cut: use UResult
2021-12-29 15:24:05 +01:00
Terts Diepraam
25c10ad540
Merge pull request #2791 from jfinkels/csplit-uresult
...
csplit: return UResult from uumain() function
2021-12-29 15:21:56 +01:00
jfinkels
8a55205521
seq: return UResult from uumain() function ( #2784 )
2021-12-29 15:20:17 +01:00
jfinkels
3f18b98c9d
dd: return UResult from uumain() function ( #2792 )
...
* dd: return UResult from uumain() function
* fixup! dd: return UResult from uumain() function
2021-12-29 15:13:52 +01:00
Terts Diepraam
645eea0c09
Merge pull request #2815 from jfinkels/printf-uresult
...
printf: return UResult from uumain() function
2021-12-29 15:10:20 +01:00
Terts Diepraam
12770ca2a9
Merge pull request #2814 from jfinkels/pinky-uresult
...
pinky: return UResult from uumain() function
2021-12-29 15:09:58 +01:00
Terts Diepraam
a285e8bfa9
Merge pull request #2813 from jfinkels/pathchk-uresult
...
pathchk: return UResult from uumain() function
2021-12-29 15:09:30 +01:00
Terts Diepraam
36b4ab4e7e
Merge pull request #2812 from jfinkels/paste-uresult
...
paste: return UResult from uumain() function
2021-12-29 15:09:12 +01:00
Terts Diepraam
80fab36639
Merge pull request #2811 from jfinkels/od-uresult
...
od: return UResult from uumain() function
2021-12-29 15:08:49 +01:00
Terts Diepraam
463127f59f
Merge pull request #2810 from jfinkels/numfmt-uresult
...
numfmt: return UResult from uumain() function
2021-12-29 15:08:27 +01:00
Terts Diepraam
5faf7a37f9
Merge pull request #2808 from jfinkels/nohup-uresult
...
nohup: return UResult from uumain() function
2021-12-29 15:08:04 +01:00
Terts Diepraam
689ae1dd84
Merge pull request #2807 from jfinkels/nice-uresult
...
nice: return UResult from uumain() function
2021-12-29 15:07:40 +01:00
Terts Diepraam
46a6b85ba0
Merge pull request #2806 from jfinkels/mv-uresult
...
mv: return UResult from uumain() function
2021-12-29 15:07:12 +01:00
Terts Diepraam
3a76cbe9b9
Merge pull request #2805 from jfinkels/mknod-uresult
...
mknod: return UResult from uumain() function
2021-12-29 15:06:37 +01:00
Terts Diepraam
92259b6959
Merge pull request #2804 from jfinkels/mkfifo-uresult
...
mkfifo: return UResult from uumain() function
2021-12-29 15:06:03 +01:00
Terts Diepraam
b81fb167e2
Merge pull request #2803 from jfinkels/logname-uresult
...
logname: return UResult from uumain() function
2021-12-29 15:05:23 +01:00
Terts Diepraam
27da982150
Merge pull request #2802 from jfinkels/link-uresult
...
link: return UResult from uumain() function
2021-12-29 15:05:01 +01:00
Terts Diepraam
50bd240451
Merge pull request #2801 from jfinkels/join-uresult
...
join: return UResult from uumain() function
2021-12-29 15:04:37 +01:00
Terts Diepraam
2d77ea6b68
Merge pull request #2800 from jfinkels/hashsum-uresult
...
hashsum: return UResult from uumain() function
2021-12-29 15:04:03 +01:00
Terts Diepraam
ee60d58410
Merge pull request #2799 from jfinkels/groups-uresult
...
groups: return UResult from uumain() function
2021-12-29 15:03:31 +01:00
Terts Diepraam
2fa0c55a6e
Merge pull request #2797 from jfinkels/factor-uresult
...
factor: return UResult from uumain() function
2021-12-29 15:02:22 +01:00
Terts Diepraam
a6f5238f19
Merge pull request #2796 from jfinkels/expand-uresult
...
expand: return UResult from uumain() function
2021-12-29 15:01:40 +01:00
Terts Diepraam
bd98dda7fb
Merge pull request #2795 from jfinkels/dircolor-uresult
...
dircolors: return UResult from uumain() function
2021-12-29 15:00:34 +01:00
Terts Diepraam
33bd5e0913
Merge pull request #2788 from jfinkels/chroot-uresult
...
chroot: return UResult from uumain() function
2021-12-29 14:59:39 +01:00
Jeffrey Finkelstein
c875eef632
printf: return UResult from uumain() function
2021-12-28 21:05:32 -05:00
Jeffrey Finkelstein
a6a4e0acd2
pinky: return UResult from uumain() function
2021-12-28 20:59:55 -05:00
Jeffrey Finkelstein
fcd5c0a30f
pathchk: return UResult from uumain() function
2021-12-28 20:43:57 -05:00
Jeffrey Finkelstein
dd9ce9d267
paste: return UResult from uumain() function
2021-12-28 20:27:13 -05:00
Jeffrey Finkelstein
45a5fb8391
od: return UResult from uumain() function
2021-12-28 20:07:21 -05:00
Jeffrey Finkelstein
595d4dbb95
numfmt: return UResult from uumain() function
2021-12-28 19:46:20 -05:00
Jeffrey Finkelstein
f91773037e
nohup: return UResult from uumain() function
2021-12-28 14:45:29 -05:00
Jeffrey Finkelstein
b89bb391c2
nice: return UResult from uumain() function
2021-12-27 19:44:26 -05:00
Jeffrey Finkelstein
d8c5b50923
mv: return UResult from uumain() function
2021-12-27 19:35:38 -05:00
Jeffrey Finkelstein
882a293974
mknod: return UResult from uumain() function
2021-12-27 18:49:35 -05:00
Jeffrey Finkelstein
b8bc5129fa
mkfifo: return UResult from uumain() function
2021-12-27 18:37:28 -05:00
Jeffrey Finkelstein
14c62cc5e3
logname: return UResult from uumain() function
2021-12-27 18:32:39 -05:00
Jeffrey Finkelstein
a882b0cf3e
link: return UResult from uumain() function
2021-12-27 18:26:25 -05:00
Jeffrey Finkelstein
a8c2beb548
join: return UResult from uumain() function
2021-12-27 15:53:21 -05:00
Jeffrey Finkelstein
354cd7d3df
hashsum: return UResult from uumain() function
2021-12-27 15:46:47 -05:00
Jeffrey Finkelstein
c3cf88df83
groups: return UResult from uumain() function
2021-12-27 15:22:55 -05:00
Jeffrey Finkelstein
be13ff4890
fmt: return UResult from uumain() function
2021-12-26 16:41:16 -05:00
Jeffrey Finkelstein
e9fc964a3e
factor: return UResult from uumain() function
2021-12-26 16:06:33 -05:00
Jeffrey Finkelstein
bb3efc7c30
expand: return UResult from uumain() function
2021-12-26 16:02:35 -05:00
Jeffrey Finkelstein
adce52571d
dircolors: return UResult from uumain() function
2021-12-26 15:57:23 -05:00
Ebuka Agbanyim
ae6e3fdaf7
cut: use UResult
2021-12-26 20:56:23 +00:00
Terts Diepraam
7ae9e0a7eb
cksum: accept directories as empty files
2021-12-26 21:50:13 +01:00
Jeffrey Finkelstein
f2bf1a7ff7
fixes suggested by nightly version of clippy
2021-12-26 15:45:33 -05:00
Jeffrey Finkelstein
a84f57dd1f
fixup! csplit: return UResult from uumain() function
2021-12-26 15:20:09 -05:00
Terts Diepraam
8885263ad5
cksum: use UIoError
2021-12-26 18:41:25 +01:00
Terts Diepraam
4b4a83ac2e
Merge pull request #2789 from jfinkels/cksum-uresult
...
cksum: return UResult from uumain() function
2021-12-26 18:30:30 +01:00
Jeffrey Finkelstein
a26fbe7c8e
csplit: return UResult from uumain() function
2021-12-25 20:19:16 -05:00
Sylvestre Ledru
5f71e0c8c8
Merge pull request #2790 from jfinkels/comm-uresult
...
comm: return UResult from uumain() function
2021-12-25 10:41:39 +01:00
Sylvestre Ledru
4ada922a4a
Merge pull request #2741 from jfinkels/seq-width-negative-decimal
...
seq: correct width for certain negative decimals
2021-12-24 20:46:43 +01:00
Jeffrey Finkelstein
2aebfc9f8d
comm: return UResult from uumain() function
2021-12-24 13:40:18 -05:00
Jeffrey Finkelstein
aacbfe681f
chroot: return UResult from uumain() function
2021-12-24 13:26:48 -05:00
Jeffrey Finkelstein
6f7ce781cb
cksum: return UResult from uumain() function
2021-12-24 13:24:09 -05:00
Jeffrey Finkelstein
294bde8e08
seq: correct width for certain negative decimals
...
Fix a bug in which a negative decimal input would not be displayed with
the correct width in the output. Before this commit, the output was
incorrectly
$ seq -w -.1 .1 .11
-0.1
0.0
0.1
After this commit, the output is correctly
$ seq -w -.1 .1 .11
-0.1
00.0
00.1
The code was failing to take into account that the input decimal "-.1"
needs to be displayed with a leading zero, like "-0.1".
2021-12-23 20:37:29 -05:00
Jeffrey Finkelstein
b8c572b32d
tac: return UResult from uumain() function
2021-12-23 20:30:51 -05:00
kimono-koans
fd64e01d92
ls: Reduce binary size of ls by removing regex crate ( #2781 )
2021-12-22 18:31:45 +01:00
Sylvestre Ledru
a3041843c9
bump the platform-info dep
2021-12-18 00:04:03 +01:00
Jeffrey Finkelstein
e88a8e8eb2
more: return Ok in main loop
2021-12-15 20:49:41 -05:00
Sylvestre Ledru
5e2dd9d0bc
Merge pull request #2767 from E3uka/more_uresult
...
more: use UResult
2021-12-15 23:40:38 +01:00
Sylvestre Ledru
5bcc53ecde
Merge pull request #2771 from E3uka/next_prev
...
more: add next-line and prev-line command.
2021-12-15 23:39:09 +01:00
electricboogie
a1960f5da0
Fix cp bug: pre-write permission change ( #2769 )
2021-12-15 22:18:02 +01:00
Ebuka Agbanyim
d2095edf6c
more: add next-line and prev-line command.
2021-12-14 19:32:38 +00:00
Ebuka Agbanyim
0bf2266ef0
more: use UResult
2021-12-13 00:37:34 +00:00
electricboogie
c7f7a222b9
Fix mv bug: Should be able to stat files, but not able to mv if source and target are the same ( #2763 )
...
Closes #2760
2021-12-12 17:49:38 +01:00
Jan Verbeek
f2ddae93fa
uucore::entries: Make Passwd::locate and Group::locate thread-safe
2021-11-26 14:48:33 +01:00
Hanif Ariffin
c86cb91dee
Merge branch 'master' of github.com:uutils/coreutils into hbina-tr-reimplement-expansion
2021-11-26 16:39:27 +08:00
Sylvestre Ledru
fe286fa8c8
Merge pull request #2749 from thomasqueirozb/utils_uresult
...
basename+date+fold+nl+nproc+shuf+uname: use UResult
2021-11-25 13:43:46 +01:00
Smicry
81a1fde9f4
tail use UResult
2021-11-21 12:37:56 +08:00
Hanif Ariffin
38659de66d
Merge branch 'master' of github.com:uutils/coreutils into hbina-tr-reimplement-expansion
2021-11-20 17:06:36 +08:00
Hanif Ariffin
0d3fa51d1e
Add license headers
...
Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
2021-11-20 17:04:28 +08:00
Roy Ivy III
7e06ddaa92
fix/tee ~ repair 'unstable_name_collisions' compiler warning
2021-11-19 21:40:22 -06:00
Roy Ivy III
7784a252f2
fix/yes ~ revise to match 'nix' changes
2021-11-19 18:04:53 -06:00
Roy Ivy III
03e0cbb020
update 'nix' within workspace to force patched version
2021-11-19 17:55:03 -06:00
Roy Ivy III
f07a1749a1
fix spell-check errors
2021-11-19 17:55:02 -06:00
Roy Ivy III
f20aa49821
maint/CICD ~ (GHA) fix cargo-udeps
false positives (add 'ignore' exceptions to sub-crates)
2021-11-19 17:55:02 -06:00
Sylvestre Ledru
43bdcaf212
Merge pull request #2532 from hbina/hbina-rm-silently-accept-presume-input-tty
...
Silently accepts ---presume-input-tty
2021-11-19 21:42:41 +01:00
Sylvestre Ledru
b4416abc82
Merge pull request #2743 from thomasqueirozb/who_uresult
...
who: use UResult
2021-11-19 21:41:14 +01:00
Sylvestre Ledru
01440734a4
Merge pull request #2735 from thomasqueirozb/printenv_env_compat
...
env+printenv: use UResult + improve compatibility
2021-11-19 21:39:34 +01:00
Sylvestre Ledru
da69ab19db
Merge pull request #2745 from thomasqueirozb/chmod_uresult
...
chmod: use UResult
2021-11-19 21:38:31 +01:00
Smicry
fc851e036b
Implement tail -<number> ( #2747 )
...
And add obsolete_syntax test
2021-11-19 21:37:47 +01:00
Thomas Queiroz
ed3e6b5201
uname: use UResult
2021-11-16 20:35:28 -03:00
Thomas Queiroz
06f3db8c55
shuf: use UResult
2021-11-16 20:35:28 -03:00
Thomas Queiroz
bcef1d6cca
nproc: use UResult
2021-11-16 20:35:28 -03:00
Thomas Queiroz
f015b041ec
nl: use UResult
2021-11-16 20:35:28 -03:00
Thomas Queiroz
a7d18f43b4
fold: use UResult
2021-11-16 20:35:28 -03:00
Thomas Queiroz
abc93d6f17
date: use UResult
2021-11-16 20:35:28 -03:00
Thomas Queiroz
2dc4cba64a
basename: use UResult
2021-11-16 17:51:56 -03:00
Roy Ivy III
363453f5e4
tests ~ (factor) refactor divisor()
to return quickcheck::TestResult
...
- return standard quickcheck results
- drop `a == 0 && b == 0` from test domain via TestResult::discard()
- avoid divide by zero panics
- ref: #1589
2021-11-13 14:18:23 -06:00
Roy Ivy III
740d8e9bc5
docs/factor ~ (BENCHMARKING.md) fix formatting, returning missing newlines
2021-11-13 11:07:02 -06:00
Hanif Bin Ariffin
da46cc8015
Merge branch 'master' of github.com:uutils/coreutils into hbina-tr-reimplement-expansion
2021-11-13 18:33:25 +08:00
Thomas Queiroz
670ed6324b
chmod: use UResult
2021-11-12 18:29:08 -03:00
Sylvestre Ledru
177374aa5a
Merge pull request #2740 from jfinkels/seq-inf-width-spaces
...
seq: correct fixed-width spacing for inf sequences
2021-11-12 21:16:40 +01:00
nicoo
bed45602a7
factor/Cargo.toml: Document feature pending a MinRustV bump
2021-11-10 15:26:36 +01:00
nicoo
32b0178a72
factor: Update to current versions of smallvec
...
smallvec 1.0 and later wasn't compatible with Rust 1.33 but the
minimum supported Rust version for coreutils moved on.
2021-11-10 15:12:37 +01:00
Thomas Queiroz
cbe6d7d5c1
who: use UResult
2021-11-09 20:00:34 -03:00
Jeffrey Finkelstein
0b86afa858
seq: correct fixed-width spacing for inf sequences
...
Pad infinity and negative infinity values with spaces when using the
`-w` option to `seq`. This corrects the behavior of `seq` to match that
of the GNU version:
$ seq -w 1.000 inf inf | head -n 4
1.000
inf
inf
inf
Previously, it incorrectly padded with 0s instead of spaces.
2021-11-08 20:12:54 -05:00
jfinkels
2e12316ae1
seq: use BigDecimal to represent floats ( #2698 )
...
* seq: use BigDecimal to represent floats
Use `BigDecimal` to represent arbitrary precision floats in order to
prevent numerical precision issues when iterating over a sequence of
numbers. This commit makes several changes at once to accomplish this
goal.
First, it creates a new struct, `PreciseNumber`, that is responsible for
storing not only the number itself but also the number of digits (both
integer and decimal) needed to display it. This information is collected
at the time of parsing the number, which lives in the new
`numberparse.rs` module.
Second, it uses the `BigDecimal` struct to store arbitrary precision
floating point numbers instead of the previous `f64` primitive
type. This protects against issues of numerical precision when
repeatedly accumulating a very small increment.
Third, since neither the `BigDecimal` nor `BigInt` types have a
representation of infinity, minus infinity, minus zero, or NaN, we add
the `ExtendedBigDecimal` and `ExtendedBigInt` enumerations which extend
the basic types with these concepts.
* fixup! seq: use BigDecimal to represent floats
* fixup! seq: use BigDecimal to represent floats
* fixup! seq: use BigDecimal to represent floats
* fixup! seq: use BigDecimal to represent floats
* fixup! seq: use BigDecimal to represent floats
2021-11-06 15:44:42 +01:00
equal-l2
cda3d5a29b
ls: add possible value for --color=
2021-11-06 03:42:27 +09:00
Thomas Queiroz
a290c77cfc
env: add contributor
2021-11-04 20:18:59 -03:00
Hanif Bin Ariffin
ac68bc9ac7
Merge branch 'master' of github.com:uutils/coreutils into hbina-rm-silently-accept-presume-input-tty
2021-11-04 16:57:14 +08:00
Hanif Bin Ariffin
a9bc457d89
Merge branch 'master' of github.com:uutils/coreutils into hbina-tr-reimplement-expansion
2021-11-04 16:55:55 +08:00
Jan Scheer
18a06c310e
tail: add some tweaks to pass more of GNU's testsuite checks related to -F
2021-11-03 14:40:57 +01:00
Thomas Queiroz
8ad95c375a
env: force specifying command with --chdir
2021-11-02 20:06:23 -03:00
Thomas Queiroz
013405d1e6
env: change -c to -C
2021-11-02 19:51:45 -03:00
Thomas Queiroz
3d74e7b452
env: prevent panic when unsetting invalid variable
2021-11-02 19:42:52 -03:00
Thomas Queiroz
db00fab7e4
env: use UResult everywhere
2021-11-02 19:17:54 -03:00
Thomas Queiroz
b157a73a1f
printenv: change exit code when variable not found
...
GNU printenv has this behavior
2021-11-02 18:36:28 -03:00
Thomas Queiroz
f2a3a1f920
printenv: use UResult
2021-11-02 18:36:28 -03:00
Michael Debertol
a05628f018
Merge pull request #2731 from thomasqueirozb/env_empty_name
...
env: don't panic when name is empty
2021-11-02 21:33:42 +01:00
Thomas Queiroz
1afc7242a5
env: change comment
2021-11-02 17:23:34 -03:00
Thomas Queiroz
c58bd9f569
env: don't panic when name is empty
2021-11-02 16:40:03 -03:00
Hanif Bin Ariffin
5a056c2c93
Merge branch 'master' of github.com:uutils/coreutils into hbina-tr-reimplement-expansion
2021-11-02 20:58:03 +08:00
Michael Debertol
7c94bb082e
Merge pull request #2726 from thomasqueirozb/strip_pre_suffix
...
uu+tests: use strip_prefix and strip_suffix
2021-11-01 23:34:27 +01:00
Michael Debertol
3fdff304db
cp: handle edge cases when dest is a symlink
...
- Fail if dest is a dangling symlink
- Fail if dest is a symlink that was previously created by the same
invocation of cp
2021-11-01 22:48:48 +01:00
Michael Debertol
8696193b66
cat: use FileInformation from uucore
2021-11-01 22:42:15 +01:00
Hanif Bin Ariffin
33b5e67bea
Merge branch 'master' of github.com:uutils/coreutils into hbina-tr-reimplement-expansion
2021-10-30 10:01:41 +08:00
Kevin Burke
3e1c5c2d99
rm: allow -r flag to be specified multiple times
...
GNU rm allows the `-r` flag to be specified multiple times, but
uutils/coreutils would previously exit with an error.
I encountered this while attempting to run `make clean` on the
Postgres source tree (github.com/postgres/postgres).
Updates #1663 .
2021-10-28 22:47:07 -07:00
Hanif Bin Ariffin
02fd7176b7
Merge branch 'master' of https://github.com/uutils/coreutils into hbina-tr-reimplement-expansion
2021-10-27 13:08:57 +08:00
Jan Scheer
63e9cd9202
Merge branch 'master' into tail_notify
2021-10-26 16:45:46 +02:00
Jan Scheer
2238a87bb7
tail: implement --retry
and -F
...
* this also fixes a lot of small bugs with `--follow={Descriptor,Name} with/without `--retry`
2021-10-26 16:21:45 +02:00
Thomas Queiroz
007f1b9f84
uu+tests: use strip_prefix and strip_suffix
2021-10-24 12:23:32 -03:00
Sylvestre Ledru
15fcbf3aac
Merge pull request #2728 from thomasqueirozb/uniq_uresult
...
uniq: use UResult
2021-10-24 09:46:22 +02:00
Hanif Bin Ariffin
002584d0dd
Merge branch 'hbina-tr-reimplement-expansion' of github.com:hbina/coreutils into hbina-tr-reimplement-expansion
2021-10-24 11:41:19 +08:00
Hanif Bin Ariffin
2dad536785
Merge branch 'master' of github.com:uutils/coreutils into hbina-tr-reimplement-expansion
...
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-10-24 11:40:42 +08:00
Thomas Queiroz
ea9b239841
uniq: use UResult
2021-10-24 00:03:33 -03:00
Thomas Queiroz
1f15b8fce4
cksum: use while loops instead of unroll!
2021-10-23 23:25:22 -03:00
Thomas Queiroz
21a2d0ce40
sort: use Range.is_empty
2021-10-23 23:22:21 -03:00
Thomas Queiroz
5e5bb91043
sort: remove unecessary implementation
2021-10-23 23:21:45 -03:00
Sylvestre Ledru
43e85ae9ce
install: Also import fs from uucore
2021-10-24 00:33:00 +02:00
Sylvestre Ledru
6946377e02
cp: Also import entries from uucore
2021-10-24 00:29:24 +02:00
Sylvestre Ledru
b5977021bc
Fix the uu_base32 dep
2021-10-24 00:12:05 +02:00
Sylvestre Ledru
995826e4a2
Merge pull request #2724 from sylvestre/silent-a-warning-2
...
Ignore two question-mark warnings
2021-10-23 23:46:59 +02:00
Sylvestre Ledru
d286c3ba4b
Merge pull request #2723 from Smicry/master
...
uniq: use UResult in util
2021-10-23 21:35:51 +02:00
Sylvestre Ledru
a5bc2211d5
Ignore two question-mark warnings
2021-10-23 20:59:19 +02:00
Sylvestre Ledru
f28da04fc5
Merge pull request #2722 from sylvestre/version
...
Prepare version 0.0.8
2021-10-23 20:56:27 +02:00
Smicry
0ffbf28cba
uniq: use UResult in util
2021-10-24 02:02:49 +08:00
Sylvestre Ledru
59e9870c56
Prepare version 0.0.8
2021-10-23 19:21:50 +02:00
Sylvestre Ledru
3ffc4c07eb
fix a map-clone warning
2021-10-23 19:19:52 +02:00
Sylvestre Ledru
4c8b74797f
Silent question_mark clippy warnings
2021-10-23 19:19:36 +02:00
Sylvestre Ledru
610fde45ef
Merge pull request #2709 from jaggededgedjustice/support-symboli-modes
...
Add symbolic mode support to mkdir
2021-10-23 17:54:15 +02:00
Sylvestre Ledru
811698b658
Merge pull request #2712 from jfinkels/head-take-lines-reader
...
head: use std::io::copy() with TakeLines reader
2021-10-23 17:53:44 +02:00
Sylvestre Ledru
803c05cb4a
Merge pull request #2720 from Smicry/master
...
head: use UResult in util
2021-10-23 17:53:35 +02:00
Hanif Bin Ariffin
6c67f19df4
Merge branch 'master' of https://github.com/uutils/coreutils into hbina-tr-reimplement-expansion
...
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-10-21 13:31:51 +08:00
Jeffrey Finkelstein
858b0a9e9f
head: use std::io::copy() with TakeLines reader
...
Replace the custom `split::walk_lines()` function with a call to
`std::io::copy()`, using a new `TakeLines` reader as the source and
`stdout` as the destination. The `TakeLines` reader is an adaptor that
scans the bytes being read for line ending characters and stops the
reading after a given number of lines has been read (similar to the
`std::io::Take` adaptor).
This change
* makes the `read_n_lines()` function more concise,
* allows it to mirror the implementation of `read_n_bytes()`,
* increases the speed of `head -n NUM`.
2021-10-20 20:59:44 -04:00
Smicry
b89b11f5da
fix lint error
2021-10-21 00:22:36 +08:00
Smicry
396fa7a9b4
fix lint error
2021-10-21 00:13:28 +08:00
Smicry
2cbc2aa59b
head: use UResult in util
2021-10-20 23:49:04 +08:00
Sylvestre Ledru
ede77c6099
Merge pull request #2711 from jfinkels/hashsum-crlf-windows-across-blocks
...
hashsum: fix handling of \r\n in Windows text mode
2021-10-19 20:50:16 +02:00
Smicry
cb34b660cb
add tail usage
2021-10-19 00:15:17 +08:00
James Robson
0b2483452a
Add symbolic mode support to mkdir
2021-10-16 12:57:55 +01:00
Sylvestre Ledru
40a895f79d
Merge pull request #2705 from adamreichold/tac-mmap
...
Minor improvements to tac
2021-10-12 21:51:38 +02:00
Hanif Bin Ariffin
c4de592e90
Merge branch 'master' of github.com:uutils/coreutils into hbina-tr-reimplement-expansion
...
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-10-12 07:39:06 +08:00
Jeffrey Finkelstein
429e1d0f12
head: use default() instead of new() for options
...
Remove the `HeadOptions::new()` function in favor of the `Default`
implementation. Both were implemented, but only `Default::default()` is
needed.
2021-10-11 18:30:03 -04:00
Jeffrey Finkelstein
d1e02665bf
fixup! hashsum: fix handling of \r\n in Windows text mode
2021-10-11 18:18:29 -04:00
Jeffrey Finkelstein
c50b5ac110
hashsum: fix handling of \r\n in Windows text mode
...
Fix a bug in which "\r\n" was not being replaced with "\n" in text mode
on Windows. This would happen only if one call to `write()` ended with a
"\r" character and the next call to `write()` started with a "\n"
character. This commit fixes the bug by buffering a "\r" character if it
appears at the end of one call to `write()` and only writing if the
first character in the next call to `write()` is *not* a "\n" character.
Fixes issue #2681 .
2021-10-11 17:36:08 -04:00
Adam Reichold
86d22aaa1d
tac: Add a simple how to for benchmarking
2021-10-10 14:29:37 +02:00
Adam Reichold
c526df57b8
tac: opportunistically use memory maps
...
Since tac must read its input files completely to start processing them
from the end, it is particularly suited to use memory maps to benefit
from the page cache maintained by the operating systems to bring the
necessary data into memory as required.
This does also include situations where the input is stdin, but not via
a pipe but for example a file descriptor set up by the user's shell
through an input redirection.
2021-10-10 13:20:31 +02:00
Adam Reichold
4eab275235
tac: buffer stdout more coarsely than line-based following the GNU tac implementation.
2021-10-10 13:20:31 +02:00
Adam Reichold
28b04fa899
tac: do not use a buffered read as fs::read is more efficient and io::Stdin is buffered internally
2021-10-10 13:20:31 +02:00
Adam Reichold
0d583754ca
tac: lock stdout only once instead for each line
2021-10-10 13:20:31 +02:00
Adam Reichold
e041fda51d
tac: do not re-compile regular expression for each file
2021-10-10 13:20:31 +02:00
Adam Reichold
b4864d760e
pr: fix locking of stdout
2021-10-10 11:33:46 +02:00
Jan Scheer
3e985cb029
Merge branch 'master' into fix_chroot_2687
2021-10-10 01:04:25 +02:00
Jan Scheer
e3b35867a5
test_tail: clean up tests for --follow=name
2021-10-10 00:07:59 +02:00
Sylvestre Ledru
080d3d2fa7
Merge pull request #2697 from vulppine/cp-uresult
...
cp: uumain returns UResult, implements UError for Error enum in cp.rs
2021-10-09 11:03:33 +02:00
Sylvestre Ledru
03a037e8ea
Merge pull request #2701 from vulppine/seq-hex
...
seq: Adds hexadecimal integer parsing
2021-10-09 11:01:42 +02:00
Jan Scheer
a1206154b1
tail: fix the behavior for -f
and rename events
...
This makes uu_tail pass the "gnu/tests/tail-2/descriptor-vs-rename" test.
* add tests for descriptor-vs-rename (with/without verbose)
* fix some minor error messages
2021-10-08 23:36:41 +02:00
Jan Scheer
23d3e58f33
tail: improve file handling for --follow=name
...
* Change data structure from Vec to HashMap in order to better
keep track of files while watching them with `--follow=name`.
E.g. file paths that were removed while watching them and exit
if no files are remaining, etc.
* Move all logic related to file handling into a FileHandling trait
* Simplify handling of the verbose flag.
2021-10-07 14:37:02 +02:00
vulppine
cddd40b4e1
seq: Updates hex parse readability, adds hex test
2021-10-05 18:41:28 -07:00
Hanif Bin Ariffin
c04a0185aa
Merge branch 'master' of github.com:uutils/coreutils into hbina-tr-reimplement-expansion
...
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-10-05 16:32:03 +08:00
Thomas Queiroz
e2fa6f9412
users: use UResult
2021-10-04 19:53:46 -03:00
Thomas Queiroz
00c9710206
uucore_procs+uu: specify uucore::show_error
...
This allows crates to use `#[uucore_procs::gen_uumain]` without `use uucore::show_error` or
#[macro_use]
extern crate uucore;
Removed unecessary usage
2021-10-04 19:53:16 -03:00
Sylvestre Ledru
368fa54520
Merge pull request #2703 from thomasqueirozb/base_uresult
...
base32 + base64 + basenc: use UResult
2021-10-03 17:34:56 +02:00
Thomas Queiroz
b924774c8a
basenc: use UResult
2021-10-02 23:17:16 -03:00
Thomas Queiroz
452329ad19
base64: use UResult
2021-10-02 23:15:40 -03:00
Thomas Queiroz
97df700d67
base32: use UResult
2021-10-02 23:12:09 -03:00
Thomas Queiroz
9dd401c358
base32: base_common use UResult
2021-10-02 23:10:00 -03:00
vulppine
d5caa0d9d8
seq: Adds hexadecimal integer parsing
2021-10-02 08:15:25 -07:00
Jeffrey Finkelstein
548a5121ae
dd: use assert! instead of if then panic!
2021-10-02 10:15:15 -04:00
Jeffrey Finkelstein
6aee05a0f1
od: use assert! instead of if then panic!
2021-10-02 09:46:43 -04:00
Jeffrey Finkelstein
de158c0122
sort: replace redundant closure with function itself
2021-10-02 09:46:43 -04:00
Jeffrey Finkelstein
06ae968ecf
csplit: use assert! instead of if then panic!
2021-10-02 09:46:43 -04:00
Jeffrey Finkelstein
71b7d6b57d
more: remove redundant mut from stdout accesses
2021-10-02 09:46:43 -04:00
Jeffrey Finkelstein
d013461a6f
ls: replace redundant closure with function itself
2021-10-02 09:46:43 -04:00
Sylvestre Ledru
b2fa51ddd9
Merge pull request #2656 from jhscheer/ls_selinux
...
`ls`: add support for showing SELinux context (--context/-Z)
2021-10-02 12:56:09 +02:00
Jan Scheer
22b59289e8
Merge branch 'master' into tail_notify
2021-10-02 12:48:54 +02:00
Hanif Bin Ariffin
de605829bf
Merge branch 'master' of github.com:uutils/coreutils into hbina-tr-reimplement-expansion
2021-10-02 18:18:52 +08:00
vulppine
4319248bb6
cp: Changes '1' to 'EXIT_ERR' in UError impl
2021-10-01 16:45:19 -07:00
vulppine
c64f09dc59
cp: Adds a needed macro, changes a return
2021-10-01 15:18:05 -07:00
vulppine
4ff5fea502
cp: uumain returns UResult, UError for Error
2021-10-01 14:58:26 -07:00
Jan Scheer
94cc966535
tail: change notify backend on macOS from FSEvents
to kqueue
...
On macOS only `kqueue` is suitable for our use case because `FSEvents`
waits until file close to delivers modify events.
2021-10-01 21:33:30 +02:00
Sylvestre Ledru
01d098993b
Merge pull request #2662 from Smicry/master
...
add kill -l final new line #2644
2021-09-29 09:58:50 +02:00
Jan Scheer
22f78b113b
tail: update README
...
* add stub for `--max-unchanged-stats`
2021-09-28 21:25:04 +02:00
Jan Scheer
e935d40480
tail: implement handling of truncate event for --follow=name
2021-09-28 20:05:09 +02:00
Jan Scheer
d9cd28fab6
test_tail: add tests for --follow=name --disable-inotify
(polling)
2021-09-28 00:16:23 +02:00
Jan Scheer
c70b7a0501
tail: implement --follow=name
...
This implements `--follow=name` for create/move/delete events.
Under the hood crate `notify` provides a cross-platform notification
library.
2021-09-27 23:08:37 +02:00
Thomas Queiroz
3882df5cdc
expr: use UResult
2021-09-25 15:36:04 -03:00
Jan Scheer
a9066e2d0c
tail: switch from Notify 4.0.17 to 5.0.0-pre.13
...
* treat input filenames as PathBuf instead of String
2021-09-23 13:34:20 +02:00
Jan Scheer
8cd8c25b0d
ls: silence clippy warnings if feat_selinx is not set
2021-09-22 13:49:08 +02:00
Jan Scheer
8f229aad87
ls: move SELinux String building logic to its own function
2021-09-22 12:24:27 +02:00
Jan Scheer
8c0b7d1314
chroot: move logic so it can be triggered by tests
...
* move the command building logic before the `chroot` syscall so it
will be reachable by tests that don't have root permissions.
2021-09-22 11:59:43 +02:00
Raphaël Thériault
6931dd11f1
Use non-yanked version of digest crate in hashsum
2021-09-19 12:38:56 -07:00
Hanif Bin Ariffin
f464879b12
Reduce MSRV to 1.47.0
...
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-09-19 23:15:28 +08:00