zopfli: New completion.
This commit is contained in:
parent
61d1d7df42
commit
2da4ee9ad5
@ -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
31
completions/zopfli
Normal 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
|
1
test/completion/zopfli.exp
Normal file
1
test/completion/zopfli.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions zopfli
|
18
test/lib/completions/zopfli.exp
Normal file
18
test/lib/completions/zopfli.exp
Normal file
@ -0,0 +1,18 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "zopfli "
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user