htop: New completoin.
This commit is contained in:
parent
bb5200695b
commit
5dba39cbd3
@ -114,6 +114,7 @@ bashcomp_DATA = a2x \
|
||||
hddtemp \
|
||||
hid2hci \
|
||||
hping2 \
|
||||
htop \
|
||||
htpasswd \
|
||||
iconv \
|
||||
id \
|
||||
|
32
completions/htop
Normal file
32
completions/htop
Normal 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
1
test/completion/htop.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions htop
|
20
test/lib/completions/htop.exp
Normal file
20
test/lib/completions/htop.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "htop -"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user