Skip to content

Commit

Permalink
oggdec: New completion
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Aug 15, 2017
1 parent 2f21940 commit 0dc16d3
Show file tree
Hide file tree
Showing 5 changed files with 62 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 @@ -253,6 +253,7 @@ bashcomp_DATA = 2to3 \
_nmcli \
nslookup \
ntpdate \
oggdec \
openssl \
opera \
optipng \
Expand Down
38 changes: 38 additions & 0 deletions completions/oggdec
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# bash completion for oggdec(1) -*- shell-script -*-

_oggdec()
{
local cur prev words cword split
_init_completion -s || return

case $prev in
--help|-h|--version|-V)
return
;;
--bits|-b)
COMPREPLY=( $( compgen -W "8 16" -- "$cur" ) )
return
;;
--endianness|-e|--sign|-s)
COMPREPLY=( $( compgen -W "0 1" -- "$cur" ) )
return
;;
--output|-o)
_filedir wav
return
;;
esac

$split && return

if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi

_filedir ogg
} &&
complete -F _oggdec oggdec

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


proc teardown {} {
assert_env_unmodified
}


setup


assert_complete_any "oggdec "
sync_after_int

assert_complete_any "oggdec --"
sync_after_int


teardown

0 comments on commit 0dc16d3

Please sign in to comment.