[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-336-gfa2876b

Ville Skyttä ville.skytta at iki.fi
Sun May 29 16:03:01 UTC 2011


The following commit has been merged in the master branch:
commit 0bd41f4edbb5a34724b030c70527ed7695a8d158
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun May 29 19:01:24 2011 +0300

    jps: New completion.

diff --git a/completions/java b/completions/java
index f848cae..1c333cd 100644
--- a/completions/java
+++ b/completions/java
@@ -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
diff --git a/test/completion/jps.exp b/test/completion/jps.exp
new file mode 100644
index 0000000..8a04f64
--- /dev/null
+++ b/test/completion/jps.exp
@@ -0,0 +1 @@
+assert_source_completions jps
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/jps.exp
similarity index 80%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/jps.exp
index 77cd07f..62d5d71 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/jps.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "a2ps "
+assert_complete_any "jps -"
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list