pngfix: New completion
This commit is contained in:
parent
4a4afd5eab
commit
13ad1f1966
@ -266,6 +266,7 @@ bashcomp_DATA = 2to3 \
|
||||
pm-hibernate \
|
||||
pm-is-supported \
|
||||
pm-powersave \
|
||||
pngfix \
|
||||
portinstall \
|
||||
portsnap \
|
||||
portupgrade \
|
||||
|
35
completions/pngfix
Normal file
35
completions/pngfix
Normal 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
|
1
test/completion/pngfix.exp
Normal file
1
test/completion/pngfix.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions pngfix
|
21
test/lib/completions/pngfix.exp
Normal file
21
test/lib/completions/pngfix.exp
Normal 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
|
Loading…
x
Reference in New Issue
Block a user