Skip to content

Commit

Permalink
feat(b2sum): new completion
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronkrogers committed Jun 7, 2023
1 parent 47aa0a2 commit cd985df
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion completions/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ symlinks: $(DATA)
$(ss) sbcl \
sbcl-mt
$(ss) sha256sum \
md5sum shasum sha1sum sha224sum sha384sum sha512sum
b2sum md5sum shasum sha1sum sha224sum sha384sum sha512sum
$(ss) ssh \
autossh scp sftp sidedoor slogin
$(ss) sudo \
Expand Down
2 changes: 1 addition & 1 deletion completions/sha256sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ _comp_cmd_sha256sum()
((${#COMPREPLY[@]})) &&
_comp_compgen -- -X "*.$sumtype" -W '"${COMPREPLY[@]}"'
} &&
complete -F _comp_cmd_sha256sum md5sum sha{,1,224,256,384,512}sum
complete -F _comp_cmd_sha256sum b2sum md5sum sha{,1,224,256,384,512}sum

# ex: filetype=sh
1 change: 1 addition & 0 deletions test/t/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ EXTRA_DIST = \
test_avahi_browse.py \
test_avctrl.py \
test_awk.py \
test_b2sum.py \
test_badblocks.py \
test_base64.py \
test_bash.py \
Expand Down
12 changes: 12 additions & 0 deletions test/t/test_b2sum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pytest


class TestB2sum:
@pytest.mark.complete("b2sum ")
def test_1(self, completion):
assert completion

@pytest.mark.complete("b2sum -", require_longopt=True)
def test_options(self, completion):
assert completion

1 change: 1 addition & 0 deletions test/test-cmd-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ autoscan
autossh
avahi-browse
awk
b2sum
badblocks
base64
bash
Expand Down

0 comments on commit cd985df

Please sign in to comment.