Merge branch 'master' into 1.x

This commit is contained in:
David Paleino 2011-01-20 22:59:49 +01:00
commit c300c652ad
10 changed files with 142 additions and 7 deletions

View File

@ -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.

View File

@ -107,6 +107,7 @@ bashcomp_DATA = abook \
ntpdate \
openldap \
openssl \
open-iscsi \
p4 \
perl \
pine \

View File

@ -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

78
completions/open-iscsi Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
assert_source_completions iscsiadm

View File

@ -0,0 +1 @@
assert_source_completions xfreerdp

View File

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

View File

@ -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