jps: New completion.
This commit is contained in:
parent
5a5683c080
commit
0bd41f4edb
@ -521,6 +521,29 @@ _javaws()
|
|||||||
} &&
|
} &&
|
||||||
complete -F _javaws 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:
|
# Local variables:
|
||||||
# mode: shell-script
|
# mode: shell-script
|
||||||
# sh-basic-offset: 4
|
# sh-basic-offset: 4
|
||||||
|
1
test/completion/jps.exp
Normal file
1
test/completion/jps.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions jps
|
20
test/lib/completions/jps.exp
Normal file
20
test/lib/completions/jps.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "jps -"
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user