Commit graph

1883 commits

Author SHA1 Message Date
anastygnome
f5ae859c38 Adds a test for sync.
It is probably too hard to verify that the sync is actually performed,
so we just check that we have a test using the code path, pro forma.

Signed-off-by: anastygnome <noreplygitemail@protonmail.com>
2022-06-05 09:43:59 +02:00
Sylvestre Ledru
69c2871336
Merge pull request #3568 from jfinkels/mktemp-tmpdir-subdirectory
mktemp: combine `--tmpdir` and subdirectory info
2022-06-05 09:33:47 +02:00
Sylvestre Ledru
e2782e2f75
Merge pull request #3583 from cakebaker/ticket_3574
expand: show error if --tabs arg has invalid chars
2022-06-05 09:31:21 +02:00
Daniel Hofstetter
9651cff6c0 expand: show error if --tabs arg has invalid chars
Fixes #3574
2022-06-03 10:36:42 +02:00
Terts Diepraam
626ed43e05 ls: fix double quoting when color is enabled
When color was enabled the escape_name function was called twice which led to names like `hello world` being displayed as `"'hello world'".
2022-06-03 00:29:56 +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
Jeffrey Finkelstein
a9e008f230 mktemp: add test for combining --tmpdir, subdir
Add a unit test for combining the directory given in `--tmpdir` with
any subdirectory structure appearing in the prefix of the template
string. For example,

    $ mktemp --tmpdir=a b/cXXX
    a/b/cNqJ

This behavior is currently working, but a unit test was missing.
2022-06-01 18:22:17 -04: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
Daniel Hofstetter
598fdc4430 dircolors: make -b & -c args overridable 2022-05-27 10:36:49 +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
Sylvestre Ledru
549c642519
Merge pull request #3559 from cakebaker/update_dircolors_database
dircolors: update internal db
2022-05-25 13:10:28 +02:00
Daniel Hofstetter
74a5938acf dircolors: test for correct error for -bp and -cp 2022-05-24 15:32:01 +02:00
Daniel Hofstetter
ba746250fb dircolors: update internal db 2022-05-24 13:56:15 +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
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
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
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
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
353fc443
2383950403
mktemp: Added tests for checking directory permissions 2022-05-16 18:05:59 +00:00
Sylvestre Ledru
40095e1b50
Merge pull request #3438 from jfinkels/chown-nonexistent-user-id
chown: allow setting arbitrary numeric user ID
2022-05-14 09:20:01 +02:00
Sylvestre Ledru
9044d96123
Merge pull request #3523 from jhscheer/fix_stat_redirect
test_stat: expand scope for stdin tests
2022-05-14 09:18:40 +02:00
ilkecan
530d5f6dbf mv: allow a single source with --target-directory 2022-05-14 03:00:29 +00:00
Jeffrey Finkelstein
896bbec760 all: clippy fixes 2022-05-13 22:47:56 -04:00
Jan Scheer
fa94591b72
test_stat: expand scope for stdin tests
On Android and macOS all/some tests for stdin fail with:
`cannot stat '-': No such file or directory`
Apparently the `/dev/stdin` redirect workaround doesn't work for
these targets.
2022-05-12 22:49:34 +02:00
Daniel Hofstetter
598dc79b69 df: test default blocksize in POSIX mode 2022-05-12 10:11:24 +02:00
Jeffrey Finkelstein
163df8abc1 fixup! chown: allow setting arbitrary numeric user ID 2022-05-12 08:41:17 +02:00
Jeffrey Finkelstein
55550e1a6e chown: allow setting arbitrary numeric user ID
Update `chown` to allow setting the owner of a file to a numeric user
ID regardless of whether a corresponding username exists on the
system.

For example,

    $ touch f && sudo chown 12345 f

succeeds even though there is no named user with ID 12345.

Fixes #3380.
2022-05-12 08:41:17 +02:00
Sylvestre Ledru
6a9a7d76fc
Merge pull request #3498 from jhscheer/fix_stat_redirect
stat: improve handling of stdin/fifo (fix #3485)
2022-05-12 08:35:43 +02:00
Sylvestre Ledru
1ca4cf5ea7
Merge pull request #3512 from jfinkels/mktemp-invalid-template-path-sep
mktemp: error on path separator in template prefix
2022-05-12 08:34:50 +02:00
Sylvestre Ledru
c212f4a556
Merge pull request #3513 from cakebaker/portability_headers
df: implement POSIX conform header line
2022-05-12 08:33:50 +02:00