pngfix: New completion

This commit is contained in:
Ville Skyttä 2014-04-06 13:09:21 +03:00
parent 4a4afd5eab
commit 13ad1f1966
4 changed files with 58 additions and 0 deletions

View File

@ -266,6 +266,7 @@ bashcomp_DATA = 2to3 \
pm-hibernate \
pm-is-supported \
pm-powersave \
pngfix \
portinstall \
portsnap \
portupgrade \

35
completions/pngfix Normal file
View File

@ -0,0 +1,35 @@
# pngfix completion -*- shell-script -*-
_pngfix()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
--suffix|--prefix)
return
;;
--output)
_filedir
return
;;
--strip)
COMPREPLY=( $( IFS='|' compgen -W '$( "$1" --help 2>&1 |
sed -ne "s/.*--strip=\[\([^]]*\)\].*/\1/p" )' -- "$cur" ) )
return
;;
esac
$split && return
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
_filedir png
} &&
complete -F _pngfix pngfix
# ex: ts=4 sw=4 et filetype=sh

View File

@ -0,0 +1 @@
assert_source_completions pngfix

View File

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