jps: New completion.

This commit is contained in:
Ville Skyttä 2011-05-29 19:01:24 +03:00
parent 5a5683c080
commit 0bd41f4edb
3 changed files with 44 additions and 0 deletions

View File

@ -521,6 +521,29 @@ _javaws()
} &&
complete -F _javaws javaws
have jps &&
_jps()
{
local cur prev words cword
_init_completion || return
case $prev in
-J*|-help)
return
;;
esac
if [[ $cur == -* ]]; then
# Not using _parse_usage because output has [-help] which does not
# mean -h, -e, -l, -p...
COMPREPLY=( $( compgen -W "-q -m -l -v -V -J -help" -- "$cur" ) )
[[ $COMPREPLY == -J* ]] && compopt -o nospace
else
_known_hosts_real "$cur"
fi
} &&
complete -F _jps jps
# Local variables:
# mode: shell-script
# sh-basic-offset: 4

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

@ -0,0 +1 @@
assert_source_completions jps

View File

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