zopfli: New completion.

master
Ville Skyttä 2013-08-23 13:42:22 +03:00
parent 61d1d7df42
commit 2da4ee9ad5
4 changed files with 52 additions and 1 deletions

View File

@ -378,7 +378,8 @@ bashcomp_DATA = 2to3 \
xz \
xzdec \
ypmatch \
yum-arch
yum-arch \
zopfli
EXTRA_DIST = $(bashcomp_DATA) \
_mock _modules _nmcli _subversion _udevadm _yum _yum-utils

31
completions/zopfli Normal file
View File

@ -0,0 +1,31 @@
# bash completion for zopfli -*- shell-script -*-
_zopfli()
{
local cur prev words cword
_init_completion || return
case $prev in
-h)
return
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W \
'$( _parse_help "$1" -h | sed -e "s/#$//" )' -- "$cur" ) )
[[ $COMPREPLY == --i ]] && compopt -o nospace
return
fi
local IFS=$'\n' xspec="*.@(gz|t[ag]z)"
_expand || return 0
compopt -o filenames
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
$( compgen -d -- "$cur" ) )
} &&
complete -F _zopfli zopfli
# ex: ts=4 sw=4 et filetype=sh

View File

@ -0,0 +1 @@
assert_source_completions zopfli

View File

@ -0,0 +1,18 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "zopfli "
sync_after_int
teardown