htop: New completoin.

master
Igor Murzov 2011-12-18 21:59:15 +04:00
parent bb5200695b
commit 5dba39cbd3
4 changed files with 54 additions and 0 deletions

View File

@ -114,6 +114,7 @@ bashcomp_DATA = a2x \
hddtemp \
hid2hci \
hping2 \
htop \
htpasswd \
iconv \
id \

32
completions/htop Normal file
View File

@ -0,0 +1,32 @@
# htop(1) completion -*- shell-script -*-
_htop()
{
local cur prev words cword split
_init_completion -s || return
case "$prev" in
-s|--sort-key)
COMPREPLY=( $( compgen -W '$( "$1" -s help )' -- "$cur" ) )
return
;;
-u|--user)
_usergroup
return
;;
-d|--delay)
# argument required but no completions available
return
;;
esac
$split && return
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
} && complete -F _htop htop
# ex: ts=4 sw=4 et filetype=sh

1
test/completion/htop.exp Normal file
View File

@ -0,0 +1 @@
assert_source_completions htop

View File

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