summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2011-02-06 15:15:20 +0200
committerVille Skyttä <ville.skytta@iki.fi>2011-02-06 15:15:20 +0200
commitcb01d8ea5434c2c9f4826b35f5f687d7723102e8 (patch)
tree92c5d86dc3ed705fe6822d96feac01655e49c2d8
parent558920aecbce226d7eb8aea8bf1c9c2290ec3f70 (diff)
downloadbash-completion-cb01d8ea5434c2c9f4826b35f5f687d7723102e8.tar.gz
Add javaws completion.
-rw-r--r--CHANGES6
-rw-r--r--completions/java30
-rw-r--r--test/completion/javaws.exp1
-rw-r--r--test/lib/completions/javaws.exp20
4 files changed, 54 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 642f124c..d54844c6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -14,9 +14,9 @@ bash-completion (2.x)
[ Ville Skyttä ]
* Activate hping2 completion also for hping and hping3.
* Add badblocks, compgen, crontab, dumpe2fs, e2freefrag, e2label, ether-wake,
- filefrag, gendiff, growisofs, iftop, ip (Debian: #600617), kid3, lrzip,
- lsof, mktemp, portecle, POSIX sh, sha{,224,256,384,512}sum, sysbench,
- tune2fs, xmodmap, and xrdb completions.
+ filefrag, gendiff, growisofs, iftop, ip (Debian: #600617), javaws, kid3,
+ lrzip, lsof, mktemp, portecle, POSIX sh, sha{,224,256,384,512}sum,
+ sysbench, tune2fs, xmodmap, and xrdb completions.
* Add *.gif (Alioth: #312512), *.m2t (Alioth: #312770), *.3gpp, *.3gpp2,
*.awb, and *.iso (Alioth: #311420) to mplayer filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions.
diff --git a/completions/java b/completions/java
index 999e6bfc..460ae285 100644
--- a/completions/java
+++ b/completions/java
@@ -494,6 +494,36 @@ _jarsigner()
} &&
complete -F _jarsigner jarsigner
+have javaws &&
+_javaws()
+{
+ COMPREPLY=()
+ local cur prev
+ _get_comp_words_by_ref cur prev
+
+ case $prev in
+ -help|-license|-about|-viewer|-arg|-param|-property|-update|-umask)
+ return 0
+ ;;
+ -basedir|-codebase)
+ _filedir -d
+ return 0
+ ;;
+ -uninstall|-import)
+ _filedir jnlp
+ return 0
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W "$( _parse_help "$1" -help ) " -- "$cur" ) )
+ return 0
+ fi
+
+ _filedir jnlp
+} &&
+complete -F _javaws javaws
+
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/test/completion/javaws.exp b/test/completion/javaws.exp
new file mode 100644
index 00000000..c1c6b106
--- /dev/null
+++ b/test/completion/javaws.exp
@@ -0,0 +1 @@
+assert_source_completions javaws
diff --git a/test/lib/completions/javaws.exp b/test/lib/completions/javaws.exp
new file mode 100644
index 00000000..cb29c65a
--- /dev/null
+++ b/test/lib/completions/javaws.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "javaws "
+
+
+sync_after_int
+
+
+teardown