summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Paleino <dapal@debian.org>2011-01-20 22:59:49 +0100
committerDavid Paleino <dapal@debian.org>2011-01-20 22:59:49 +0100
commitc300c652ad8000e270726331ecf70fb0bae17e14 (patch)
tree9774734e275b1ee02ff40be584c2d8e6bf82328d
parent8d152a2f75964afb52f25b617719168c7f4a95b3 (diff)
parent25df3092630bde800e3d5d743aeac614e5216c10 (diff)
downloadbash-completion-c300c652ad8000e270726331ecf70fb0bae17e14.tar.gz
Merge branch 'master' into 1.x
-rw-r--r--CHANGES9
-rw-r--r--completions/Makefile.am1
-rw-r--r--completions/java7
-rw-r--r--completions/open-iscsi78
-rw-r--r--completions/xmllint2
-rw-r--r--completions/xmlwf2
-rw-r--r--test/completion/iscsiadm.exp1
-rw-r--r--test/completion/xfreerdp.exp1
-rw-r--r--test/lib/completions/iscsiadm.exp20
-rw-r--r--test/lib/completions/xfreerdp.exp28
10 files changed, 142 insertions, 7 deletions
diff --git a/CHANGES b/CHANGES
index 4a564da7..25cba1bc 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@ bash-completion (1.3)
[ Guillaume Rousse ]
* added pure-perl perldoc completion helper, using work from Aristotle
Pagaltzis (pagaltzis@gmx.de)
+ * added completions for xfreerdp and iscsiadm
[ David Paleino ]
* Fixed "service" completion, thanks to John Hedges (Debian: #586210)
@@ -19,11 +20,11 @@ bash-completion (1.3)
*.awb, and *.iso (Alioth: #311420) to mplayer filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions.
* Improve /etc/init.d/*, ipmitool, jar, java, javadoc, man, mencoder, mkdir,
- mplayer, povray, python, rpmbuild, sqlite3, tar, wodim, and general help
- parsing completions.
+ mplayer, pack200, povray, python, rpmbuild, sqlite3, tar, wodim, and
+ general help parsing completions.
* Fix p4 and povray completions (Alioth: #312625).
- * Add *.xsd, *.xsl, *.rng, and *.wsdl to xmllint filename completions,
- and *.gz versions of all of the supported ones.
+ * Add *.xsd, *.xsl, *.rng, *.wsdl, and *.jnlp to xmllint and xmlwf filename
+ completions, and *.gz versions of all of the supported ones for xmllint.
* Recognize rpm query mode based on the --file, --group, --package, and
--all long options (RedHat: #630328).
* Improve rpm query option completions.
diff --git a/completions/Makefile.am b/completions/Makefile.am
index fb423253..38cd986d 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -107,6 +107,7 @@ bashcomp_DATA = abook \
ntpdate \
openldap \
openssl \
+ open-iscsi \
p4 \
perl \
pine \
diff --git a/completions/java b/completions/java
index 8365a314..eacd85e3 100644
--- a/completions/java
+++ b/completions/java
@@ -356,6 +356,10 @@ _pack200()
_filedir log
return 0
;;
+ -r|--repack)
+ _filedir jar
+ return 0
+ ;;
esac
# Check if a pack or a jar was already given.
@@ -374,7 +378,8 @@ _pack200()
--deflate-hint= --modification-time= --pass-file= \
--unknown-attribute= --class-attribute= --field-attribute= \
--method-attribute= --code-attribute= --config-file= \
- --verbose --quiet --log-file= --help --version -J' -- "$cur" ) )
+ --verbose --quiet --log-file= --help --version -J \
+ --repack' -- "$cur" ) )
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} == *= ]] && \
type compopt &>/dev/null && compopt -o nospace
else
diff --git a/completions/open-iscsi b/completions/open-iscsi
new file mode 100644
index 00000000..8c650d59
--- /dev/null
+++ b/completions/open-iscsi
@@ -0,0 +1,78 @@
+# iscsiadm(1) completion
+
+have iscsiadm &&
+_iscsiadm()
+{
+ local cur prev mode split=false
+
+ COMPREPLY=()
+ _get_comp_words_by_ref cur prev
+
+ _split_longopt && split=true
+
+ case $prev in
+ -m|--mode)
+ COMPREPLY=( $( compgen -W 'discovery node session iface fw host' \
+ -- "$cur" ) )
+ return 0;
+ ;;
+ -o|--op)
+ COMPREPLY=( $( compgen -W 'new delete update show' -- "$cur" ) )
+ return 0;
+ ;;
+ -t|--type)
+ COMPREPLY=( $( compgen -W 'sendtargets st slp isns fw' -- "$cur" ) )
+ return 0;
+ ;;
+ -L|-U|--loginall|--logoutall)
+ COMPREPLY=( $( compgen -W 'all manual automatic' -- "$cur" ) )
+ return 0;
+ ;;
+ esac
+
+ $split && return 0
+
+ local options
+ if [[ $COMP_CWORD -gt 1 ]] ; then
+ mode=${COMP_WORDS[2]}
+
+ case $mode in
+ discovery)
+ options='--help --version --debug --print --interface --type \
+ --portal --login --op --name --value'
+ ;;
+ node)
+ options='--help --version --debug --print --loginall \
+ --logoutall--show -T --portal --interface --login \
+ --logout --rescan --stats --op --name --value'
+ ;;
+ session)
+ options='--help --version --debug --print --sid --logout \
+ --rescan --stats'
+ ;;
+ iface)
+ options='--help --version --debug --print --interface --op \
+ --name --value'
+ ;;
+ fw)
+ options='--login'
+ ;;
+ host)
+ options='--print -H'
+ ;;
+ esac
+ else
+ options='--mode'
+ fi
+
+ COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
+} &&
+complete -F _iscsiadm iscsiadm
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/xmllint b/completions/xmllint
index bed3b42d..5b9c301c 100644
--- a/completions/xmllint
+++ b/completions/xmllint
@@ -42,7 +42,7 @@ _xmllint()
return 0
fi
- _filedir '@(*ml|htm|svg|xs[dl]|rng|wsdl)?(.gz)'
+ _filedir '@(*ml|htm|svg|xs[dl]|rng|wsdl|jnlp)?(.gz)'
} &&
complete -F _xmllint xmllint
diff --git a/completions/xmlwf b/completions/xmlwf
index 74cf0812..ba02524b 100644
--- a/completions/xmlwf
+++ b/completions/xmlwf
@@ -26,7 +26,7 @@ _xmlwf()
return 0
fi
- _filedir '@(*ml|htm|svg)'
+ _filedir '@(*ml|htm|svg|xs[dl]|rng|wsdl|jnlp)'
} &&
complete -F _xmlwf xmlwf
diff --git a/test/completion/iscsiadm.exp b/test/completion/iscsiadm.exp
new file mode 100644
index 00000000..6d760dd4
--- /dev/null
+++ b/test/completion/iscsiadm.exp
@@ -0,0 +1 @@
+assert_source_completions iscsiadm
diff --git a/test/completion/xfreerdp.exp b/test/completion/xfreerdp.exp
new file mode 100644
index 00000000..5ca649a2
--- /dev/null
+++ b/test/completion/xfreerdp.exp
@@ -0,0 +1 @@
+assert_source_completions xfreerdp
diff --git a/test/lib/completions/iscsiadm.exp b/test/lib/completions/iscsiadm.exp
new file mode 100644
index 00000000..104e7c4e
--- /dev/null
+++ b/test/lib/completions/iscsiadm.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "iscsiadm --mode "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xfreerdp.exp b/test/lib/completions/xfreerdp.exp
new file mode 100644
index 00000000..f61cfcad
--- /dev/null
+++ b/test/lib/completions/xfreerdp.exp
@@ -0,0 +1,28 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+set test "Tab should complete options"
+set cmd "xfreerdp --"
+send "$cmd\t"
+set expected "^$cmd\r\n--data.*--kbd-list.*--plugin\r\n/@$cmd$"
+expect {
+ -re $expected { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ default { unresolved "$test" }
+}
+
+
+sync_after_int
+
+
+teardown