Skip to content

Commit 594de4e

Browse files
pixelbscop
andauthored
feat(coreutils): update for newer GNU coreutils (#1457)
* feat(coreutils): update for newer GNU coreutils Adjust for changes in GNU coreutils. Valid as of coreutils 9.5 (Mar 2024). Add completions for: base32, basenc, cksum, comm, numfmt, readlink, realpath, shred, shuf, stat, sync Adjust completions for: chgrp: add --from dd: remove deprecated *_bytes flags Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
1 parent 14c75f9 commit 594de4e

19 files changed

+154
-8
lines changed

bash_completion

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,11 +3150,12 @@ _comp_complete_longopt()
31503150
}
31513151
# makeinfo and texi2dvi are defined elsewhere.
31523152
complete -F _comp_complete_longopt \
3153-
a2ps awk base64 bash bc bison cat chroot colordiff cp \
3153+
a2ps awk base{32,64,nc} bash bc bison cat chroot colordiff comm cp \
31543154
csplit cut date df diff dir du enscript expand fmt fold gperf \
31553155
grep grub head irb ld ldd less ln ls m4 mkdir mkfifo mknod \
3156-
mv netstat nl nm objcopy objdump od paste pr ptx readelf rm rmdir \
3157-
sed seq shar sort split strip sum tac tail tee \
3156+
mv netstat nl nm numfmt objcopy objdump od paste pr ptx readelf \
3157+
readlink realpath rm rmdir sed seq shar shred \
3158+
shuf sort split stat strip sum sync tac tail tee \
31583159
texindex touch tr uname unexpand uniq units vdir wc who
31593160
31603161
# @since 2.12

completions/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
/ciptool
6262
/civclient
6363
/civserver
64+
/cksum
6465
/_cloudquery
6566
/_clusterctl
6667
/clzip

completions/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ CLEANFILES = \
622622
ciptool \
623623
civclient \
624624
civserver \
625+
cksum \
625626
_cloudquery \
626627
_clusterctl \
627628
clzip \
@@ -1496,7 +1497,7 @@ endif
14961497
$(ss) sbcl \
14971498
sbcl-mt
14981499
$(ss) sha256sum \
1499-
b2sum md5sum shasum sha1sum sha224sum sha384sum sha512sum
1500+
b2sum cksum md5sum shasum sha1sum sha224sum sha384sum sha512sum
15001501
$(ss) _sops \
15011502
_kata-runtime _todoist
15021503
$(ss) ssh \

completions/chgrp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ _comp_cmd_chgrp()
2020
for w in "${words[@]}"; do
2121
[[ $w == -@(R|-recursive) ]] && opts="-H -L -P" && break
2222
done
23-
_comp_compgen -- -W '-c -h -f -R -v --changes --dereference
23+
_comp_compgen -- -W '-c -h -f -R -v --changes --dereference --from
2424
--no-dereference --silent --quiet --reference --recursive --verbose
2525
--help --version $opts'
2626
return

completions/dd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ _comp_cmd_dd()
1818
;;
1919
iflag=* | oflag=*)
2020
_comp_compgen -c "${cur#*=}" -- -W 'append direct directory dsync
21-
sync fullblock nonblock noatime nocache noctty nofollow
22-
count_bytes skip_bytes seek_bytes'
21+
sync fullblock nonblock noatime nocache noctty nofollow'
2322
return
2423
;;
2524
status=*)

completions/sha256sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ _comp_cmd_sha256sum()
3333
_comp_compgen -v files filedir &&
3434
_comp_compgen -- -X "*.$sumtype" -W '"${files[@]}"'
3535
} &&
36-
complete -F _comp_cmd_sha256sum b2sum md5sum sha{,1,224,256,384,512}sum
36+
complete -F _comp_cmd_sha256sum b2sum cksum md5sum \
37+
sha{,1,224,256,384,512}sum
3738

3839
# ex: filetype=sh

test/t/Makefile.am

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ EXTRA_DIST = \
4242
test_awk.py \
4343
test_b2sum.py \
4444
test_badblocks.py \
45+
test_base32.py \
4546
test_base64.py \
47+
test_basenc.py \
4648
test_bash.py \
4749
test_bc.py \
4850
test_bind.py \
@@ -90,11 +92,13 @@ EXTRA_DIST = \
9092
test_civclient.py \
9193
test_civserver.py \
9294
test_cksfv.py \
95+
test_cksum.py \
9396
test_cleanarch.py \
9497
test_clisp.py \
9598
test_clone_member.py \
9699
test_co.py \
97100
test_colordiff.py \
101+
test_comm.py \
98102
test_compare.py \
99103
test_compgen.py \
100104
test_complete.py \
@@ -427,6 +431,7 @@ EXTRA_DIST = \
427431
test_nslookup.py \
428432
test_nsupdate.py \
429433
test_ntpdate.py \
434+
test_numfmt.py \
430435
test_objcopy.py \
431436
test_objdump.py \
432437
test_od.py \
@@ -521,7 +526,9 @@ EXTRA_DIST = \
521526
test_rdesktop.py \
522527
test_rdict.py \
523528
test_readelf.py \
529+
test_readlink.py \
524530
test_readonly.py \
531+
test_realpath.py \
525532
test_remove_members.py \
526533
test_removepkg.py \
527534
test_renice.py \
@@ -568,7 +575,9 @@ EXTRA_DIST = \
568575
test_sha512sum.py \
569576
test_shar.py \
570577
test_shellcheck.py \
578+
test_shred.py \
571579
test_shtab.py \
580+
test_shuf.py \
572581
test_sitecopy.py \
573582
test_slabtop.py \
574583
test_slackpkg.py \
@@ -596,6 +605,7 @@ EXTRA_DIST = \
596605
test_sshfs.py \
597606
test_sshmitm.py \
598607
test_sshow.py \
608+
test_stat.py \
599609
test_strace.py \
600610
test_stream.py \
601611
test_strings.py \
@@ -608,6 +618,7 @@ EXTRA_DIST = \
608618
test_svn.py \
609619
test_svnadmin.py \
610620
test_svnlook.py \
621+
test_sync.py \
611622
test_sync_members.py \
612623
test_synclient.py \
613624
test_sysbench.py \

test/t/test_base32.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import pytest
2+
3+
4+
class TestBase32:
5+
@pytest.mark.complete("base32 ")
6+
def test_1(self, completion):
7+
assert completion
8+
9+
@pytest.mark.complete("base32 -", require_longopt=True)
10+
def test_options(self, completion):
11+
assert completion

test/t/test_basenc.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import pytest
2+
3+
4+
class TestBasenc:
5+
@pytest.mark.complete("basenc ")
6+
def test_1(self, completion):
7+
assert completion
8+
9+
@pytest.mark.complete("basenc -", require_longopt=True)
10+
def test_options(self, completion):
11+
assert completion

test/t/test_cksum.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import pytest
2+
3+
4+
class TestCksum:
5+
@pytest.mark.complete("cksum ")
6+
def test_1(self, completion):
7+
assert completion
8+
9+
@pytest.mark.complete("cksum -", require_longopt=True)
10+
def test_options(self, completion):
11+
assert completion

0 commit comments

Comments
 (0)