Skip to content

Commit

Permalink
lsusb: New completion
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Sep 10, 2017
1 parent 5268e43 commit 4e323d9
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions completions/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ bashcomp_DATA = 2to3 \
lpr \
lrzip \
lsof \
lsusb \
lua \
luac \
luseradd \
Expand Down
20 changes: 20 additions & 0 deletions completions/lsusb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# lsusb(8) completion -*- shell-script -*-

_lsusb()
{
local cur prev words cword
_init_completion || return

case $prev in
-h|--help|-V|--version|-s|-D)
return
;;
esac

if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
fi
} &&
complete -F _lsusb lsusb

# ex: filetype=sh
1 change: 1 addition & 0 deletions test/completion/lsusb.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assert_source_completions lsusb
1 change: 1 addition & 0 deletions test/docker/Dockerfile-ubuntu14
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ RUN dpkg --add-architecture i386 && \
unrar \
units \
unixodbc \
usbutils \
valgrind \
vorbis-tools \
vpnc \
Expand Down
18 changes: 18 additions & 0 deletions test/lib/completions/lsusb.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
proc setup {} {
save_env
}


proc teardown {} {
assert_env_unmodified
}


setup


assert_complete_any "lsusb -"
sync_after_int


teardown

0 comments on commit 4e323d9

Please sign in to comment.