Commit graph

1473 commits

Author SHA1 Message Date
Jan Scheer
beb2b7cf5e
tail: use functionality from uucore::error where applicable
* minor code clean-up
* remove test-suite summary from README
2022-06-06 14:36:51 +02:00
Jan Scheer
e0efd6cc90
tail: update readme
* add clippy fixes
* add cicd fixes
2022-06-03 13:35:58 +02:00
Jan Scheer
94fe42634b
test_tail: a lot of minor improvements
* fix test_retry7
* fix test_follow_descriptor_vs_rename2
* set permissions with set_permissions instead of a call to chmod
* improve documentation
2022-06-02 17:03:49 +02:00
Jan Scheer
2e918813c1
test_tail: add test_follow_name_move_create2 2022-06-02 17:01:22 +02:00
Jan Scheer
42fa386d89
test_tail: add test_follow_truncate_fast 2022-06-02 16:56:09 +02:00
Jan Scheer
f3aacac9d8
test_tail: add test_follow_name_truncate4 2022-06-02 16:55:04 +02:00
Jan Scheer
8ee806a444
Merge branch 'main' into tail_notify 2022-06-02 16:31:25 +02:00
Sylvestre Ledru
68cc9312c8
Merge pull request #3585 from cakebaker/multiple_tabs
expand: allow multiple "tabs" args
2022-06-02 10:08:45 +02:00
Sylvestre Ledru
aeb01c6f52
Merge pull request #3563 from sylvestre/hard-to-sym
ln: Implement -L -P to make tests/ln/hard-to-sym.sh work
2022-06-02 08:19:17 +02:00
Sylvestre Ledru
36e5b60617
Merge pull request #3566 from cakebaker/print_ls_colors
dircolors: implement --print-ls-colors
2022-06-01 23:11:57 +02:00
Sylvestre Ledru
06c2aea1b4 ln: Implement -L -P to make tests/ln/hard-to-sym.sh work 2022-06-01 23:03:50 +02:00
Daniel Hofstetter
864c666467 expand: allow multiple "tabs" args 2022-06-01 16:18:57 +02:00
Sylvestre Ledru
2ed64fc9a1
Merge pull request #3573 from jfinkels/mktemp-simpler-prefix-suffix
mktemp: simplify file path parameter logic
2022-06-01 08:38:31 +01:00
Jeffrey Finkelstein
43e9fb73b1 mktemp: simplify file path parameter logic
Simplify the logic of computing the file path parameters (the
directory, prefix, suffix, and number of random characters) for the
temporary file created by `mktemp`. This commits adds an `Options`
struct as a layer of indirection between the application logic and
`clap`, and a `Params` struct whose associated function is responsible
for determining the file path parameters from the `Options`. This is
an improvement because the previous code had some logic for
determining file path parameters in one place and some in another
place.
2022-05-31 19:35:01 -04:00
Daniel Hofstetter
113c1855fd df: trim size header in tests
Fixes #3580
2022-05-31 10:34:20 +02:00
Sylvestre Ledru
e276e652dc
Merge pull request #3579 from jfinkels/df-total-label-target-column
df: show "total" label in correct column
2022-05-31 07:42:06 +01:00
Jeffrey Finkelstein
d7b528f60b df: show "total" label in correct column
Show the "total" label in the "source" column or in the "target"
column if the "source" column is not visible.

Before this commit,

    $ df --total --output=target .
    Mounted on
    /
    -

After this commit,

    $ df --total --output=target .
    Mounted on
    /
    total
2022-05-30 11:22:07 -04:00
Jeffrey Finkelstein
dfc1c8a2dd mktemp: exit with status 1 on usage errors 2022-05-30 09:30:47 -04:00
Daniel Hofstetter
6d82523a99 dircolors: implement --print-ls-colors 2022-05-30 09:11:27 +02:00
Jan Scheer
4cb6b094f5
Merge branch 'main' into tail_notify 2022-05-27 23:44:24 +02:00
Jan Scheer
bb5dc8bd2f
tail: verify that -[nc]0 without -f, exit without reading
This passes: "gnu/tests/tail-2/tail-n0f.sh"

* add tests for "-[nc]0 wo -f"

* add bubble-up UResult
* rename return_code -> exit_code
2022-05-27 23:36:31 +02:00
Daniel Hofstetter
598fdc4430 dircolors: make -b & -c args overridable 2022-05-27 10:36:49 +02:00
Jan Scheer
4bbf708c81
tail: fix handling of PermissionDenied Error
* add tests for opening unreadable files
2022-05-26 13:00:40 +02:00
Jan Scheer
6bd9a1d537
Merge branch 'main' into tail_notify 2022-05-26 00:33:12 +02:00
Jan Scheer
519ab2d172
test_tail: add two new tests for --follow
* add test_follow_name_move2
* add test_follow_multiple_untailable

* disable some tests which do not run properly on Android and/or macOS
2022-05-25 23:25:08 +02:00
Sylvestre Ledru
172f5c4182
Merge pull request #3504 from cakebaker/read_blocksize_from_env_vars
df: read block size from env vars
2022-05-25 16:41:41 +02:00
Sylvestre Ledru
fa577603c2
Merge pull request #3471 from 353fc443/mktemp-set-dir-mode
mktemp: change directory permission after creation
2022-05-25 14:56:45 +02:00
Daniel Hofstetter
74a5938acf dircolors: test for correct error for -bp and -cp 2022-05-24 15:32:01 +02:00
Daniel Hofstetter
ea284ce55e df: read block size from env vars 2022-05-23 09:24:07 +02:00
Sylvestre Ledru
c818ca0039
Merge pull request #3551 from jfinkels/mktemp-too-few-xs-suffix
mktemp: include suffix in error message
2022-05-23 08:38:15 +02:00
Jan Scheer
dc4b6f2cf9
Merge branch 'main' into tail_notify 2022-05-23 01:10:32 +02:00
Jan Scheer
6a7b6ccdbe
tail: add test_follow_name_move_retry
* add fixes to pass test_follow_name_move_retry
* fix test_follow_name_remove

* bump notify to 5.0.0-pre.15
* adjust PollWatcher::with_delay -> PollWatcher::with_config
2022-05-23 00:51:02 +02:00
Sylvestre Ledru
887f49ce2d
Merge pull request #3550 from thomasqueirozb/ls_gds
ls: implement --group-directories-first
2022-05-22 09:50:04 +02:00
Jeffrey Finkelstein
35fb4e6ea1 mktemp: include suffix in error message
Include the suffix in the error message produced by `mktemp` when
there are too few Xs in the template. Before this commit,

    $ mktemp --suffix=X aXX
    mktemp: too few X's in template 'aXX'

After this commit,

    $ mktemp --suffix=X aXX
    mktemp: too few X's in template 'aXXX'

This matches the behavior of GNU `mktemp`.
2022-05-21 21:59:06 -04:00
Thomas Queiroz
0b24839a1e
tests/ls: add --group-directories-first test 2022-05-21 18:57:53 -03:00
Thomas Queiroz
c4606266e4
tests/ls: update version sort test 2022-05-21 18:50:26 -03:00
Sylvestre Ledru
d92107362b
Merge pull request #3521 from jfinkels/mktemp-tmpdir-absolute-path
mktemp: correct error message on absolute path
2022-05-21 09:40:33 +02:00
Sylvestre Ledru
bda9f9f889
Merge pull request #3529 from ilkecan/mv-target-dir
mv: allow a single source with --target-directory
2022-05-21 09:40:16 +02:00
Jan Scheer
84480f892d
tail: add equivalent of stdin_is_pipe_or_fifo() for Windows
* add support to determine if stdin is readable on Windows
2022-05-19 22:55:47 +02:00
Jeffrey Finkelstein
6260333415 mktemp: fix error msg when suffix has path sep.
Correct the error message when the template argument contains a path
separator in its suffix. Before this commit:

    $ mktemp aXXX/b
    mktemp: too few X's in template 'b'

After this commit:

    $ mktemp aXXX/b
    mktemp: invalid suffix '/b', contains directory separator

This error message is more appropriate and matches the behavior of GNU
mktemp.
2022-05-19 15:46:04 +02:00
Jan Scheer
6a1cf72316
Merge branch 'main' into tail_notify 2022-05-18 14:28:19 +02:00
Jan Scheer
07231e6c6c
tail: fix handling of stdin redirects for macOS
On macOS path.is_dir() can be false for directories
if it was a redirect, e.g. ` tail < DIR`

* fix some tests for macOS

Cleanup:
* fix clippy/spell-checker
* fix build for windows by refactoring stdin_is_pipe_or_fifo()
2022-05-18 14:22:53 +02:00
Jeffrey Finkelstein
8a941db20a mktemp: correct error message on absolute path
Correct the error message produced by `mktemp` when `--tmpdir` is
given and the template is an absolute path:

    $ mktemp --tmpdir=a /XXX
    mktemp: invalid template, '/XXX'; with --tmpdir, it may not be absolute
2022-05-17 20:16:47 -04:00
Daniel Hofstetter
27dd59635a uucore: add InvalidSuffix to ParseSizeError 2022-05-17 15:37:49 +02:00
Jan Scheer
75a6641ced
Merge branch 'main' into tail_notify 2022-05-17 14:13:20 +02:00
353fc443 aka Seagull
124312702f
Merge branch 'main' into mktemp-set-dir-mode 2022-05-17 12:51:04 +01:00
Terts Diepraam
eac0760905
Merge pull request #3528 from jfinkels/clippy-fixes
all: clippy fixes
2022-05-17 11:57:47 +02:00
353fc443 aka Seagull
2086d04996
Merge branch 'main' into mktemp-set-dir-mode 2022-05-17 04:58:03 +00:00
Jan Scheer
409878e323
Merge branch 'main' into tail_notify 2022-05-16 22:45:52 +02:00
Jan Scheer
ede73745f5
test_tail: add various tests for follow-stdin and redirect-stdin
* add various tests adapted from `gnu/tests/tail-2/follow-stdin.sh`
* explicitly set_stdin to null where needed, otherwise stdin is always
  `piped`
* tighten some existing tests (no_stderr, code_is, etc)
* add test for fifo
2022-05-16 22:17:09 +02:00