Skip to content

Commit 4e323d9

Browse files
committed
lsusb: New completion
1 parent 5268e43 commit 4e323d9

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

completions/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ bashcomp_DATA = 2to3 \
198198
lpr \
199199
lrzip \
200200
lsof \
201+
lsusb \
201202
lua \
202203
luac \
203204
luseradd \

completions/lsusb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# lsusb(8) completion -*- shell-script -*-
2+
3+
_lsusb()
4+
{
5+
local cur prev words cword
6+
_init_completion || return
7+
8+
case $prev in
9+
-h|--help|-V|--version|-s|-D)
10+
return
11+
;;
12+
esac
13+
14+
if [[ $cur == -* ]]; then
15+
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
16+
fi
17+
} &&
18+
complete -F _lsusb lsusb
19+
20+
# ex: filetype=sh

test/completion/lsusb.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
assert_source_completions lsusb

test/docker/Dockerfile-ubuntu14

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ RUN dpkg --add-architecture i386 && \
192192
unrar \
193193
units \
194194
unixodbc \
195+
usbutils \
195196
valgrind \
196197
vorbis-tools \
197198
vpnc \

test/lib/completions/lsusb.exp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
proc setup {} {
2+
save_env
3+
}
4+
5+
6+
proc teardown {} {
7+
assert_env_unmodified
8+
}
9+
10+
11+
setup
12+
13+
14+
assert_complete_any "lsusb -"
15+
sync_after_int
16+
17+
18+
teardown

0 commit comments

Comments
 (0)