diff options
author | David Paleino <dapal@debian.org> | 2012-01-07 23:44:41 +0100 |
---|---|---|
committer | David Paleino <dapal@debian.org> | 2012-01-07 23:44:41 +0100 |
commit | a4fa390b28abb15d43a1418ae0585dc636057b84 (patch) | |
tree | a623d66e960a7d534d85c4c8d960d8c6ce93f76d /completions/htop | |
parent | 935ce88df7f6bfef86e44c732228f8575ca3cd67 (diff) | |
parent | 3ccfe020a2b7e1e3a97e725c2af001275a07d15c (diff) | |
download | bash-completion-a4fa390b28abb15d43a1418ae0585dc636057b84.tar.gz |
Merge commit '3ccfe02' into 2.x
Diffstat (limited to 'completions/htop')
-rw-r--r-- | completions/htop | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/completions/htop b/completions/htop new file mode 100644 index 00000000..7735f9b5 --- /dev/null +++ b/completions/htop @@ -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) + COMPREPLY=( $( compgen -u -- "$cur" ) ) + 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 |