Merge branch 'master' into 1.x
This commit is contained in:
commit
c300c652ad
9
CHANGES
9
CHANGES
@ -3,6 +3,7 @@ bash-completion (1.3)
|
|||||||
[ Guillaume Rousse ]
|
[ Guillaume Rousse ]
|
||||||
* added pure-perl perldoc completion helper, using work from Aristotle
|
* added pure-perl perldoc completion helper, using work from Aristotle
|
||||||
Pagaltzis (pagaltzis@gmx.de)
|
Pagaltzis (pagaltzis@gmx.de)
|
||||||
|
* added completions for xfreerdp and iscsiadm
|
||||||
|
|
||||||
[ David Paleino ]
|
[ David Paleino ]
|
||||||
* Fixed "service" completion, thanks to John Hedges (Debian: #586210)
|
* 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.
|
*.awb, and *.iso (Alioth: #311420) to mplayer filename completions.
|
||||||
* Add "short" tarball extensions to unxz, unlzma etc completions.
|
* Add "short" tarball extensions to unxz, unlzma etc completions.
|
||||||
* Improve /etc/init.d/*, ipmitool, jar, java, javadoc, man, mencoder, mkdir,
|
* Improve /etc/init.d/*, ipmitool, jar, java, javadoc, man, mencoder, mkdir,
|
||||||
mplayer, povray, python, rpmbuild, sqlite3, tar, wodim, and general help
|
mplayer, pack200, povray, python, rpmbuild, sqlite3, tar, wodim, and
|
||||||
parsing completions.
|
general help parsing completions.
|
||||||
* Fix p4 and povray completions (Alioth: #312625).
|
* Fix p4 and povray completions (Alioth: #312625).
|
||||||
* Add *.xsd, *.xsl, *.rng, and *.wsdl to xmllint filename completions,
|
* Add *.xsd, *.xsl, *.rng, *.wsdl, and *.jnlp to xmllint and xmlwf filename
|
||||||
and *.gz versions of all of the supported ones.
|
completions, and *.gz versions of all of the supported ones for xmllint.
|
||||||
* Recognize rpm query mode based on the --file, --group, --package, and
|
* Recognize rpm query mode based on the --file, --group, --package, and
|
||||||
--all long options (RedHat: #630328).
|
--all long options (RedHat: #630328).
|
||||||
* Improve rpm query option completions.
|
* Improve rpm query option completions.
|
||||||
|
@ -107,6 +107,7 @@ bashcomp_DATA = abook \
|
|||||||
ntpdate \
|
ntpdate \
|
||||||
openldap \
|
openldap \
|
||||||
openssl \
|
openssl \
|
||||||
|
open-iscsi \
|
||||||
p4 \
|
p4 \
|
||||||
perl \
|
perl \
|
||||||
pine \
|
pine \
|
||||||
|
@ -356,6 +356,10 @@ _pack200()
|
|||||||
_filedir log
|
_filedir log
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
-r|--repack)
|
||||||
|
_filedir jar
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if a pack or a jar was already given.
|
# Check if a pack or a jar was already given.
|
||||||
@ -374,7 +378,8 @@ _pack200()
|
|||||||
--deflate-hint= --modification-time= --pass-file= \
|
--deflate-hint= --modification-time= --pass-file= \
|
||||||
--unknown-attribute= --class-attribute= --field-attribute= \
|
--unknown-attribute= --class-attribute= --field-attribute= \
|
||||||
--method-attribute= --code-attribute= --config-file= \
|
--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]} == *= ]] && \
|
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} == *= ]] && \
|
||||||
type compopt &>/dev/null && compopt -o nospace
|
type compopt &>/dev/null && compopt -o nospace
|
||||||
else
|
else
|
||||||
|
78
completions/open-iscsi
Normal file
78
completions/open-iscsi
Normal 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
|
@ -42,7 +42,7 @@ _xmllint()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_filedir '@(*ml|htm|svg|xs[dl]|rng|wsdl)?(.gz)'
|
_filedir '@(*ml|htm|svg|xs[dl]|rng|wsdl|jnlp)?(.gz)'
|
||||||
} &&
|
} &&
|
||||||
complete -F _xmllint xmllint
|
complete -F _xmllint xmllint
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ _xmlwf()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_filedir '@(*ml|htm|svg)'
|
_filedir '@(*ml|htm|svg|xs[dl]|rng|wsdl|jnlp)'
|
||||||
} &&
|
} &&
|
||||||
complete -F _xmlwf xmlwf
|
complete -F _xmlwf xmlwf
|
||||||
|
|
||||||
|
1
test/completion/iscsiadm.exp
Normal file
1
test/completion/iscsiadm.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions iscsiadm
|
1
test/completion/xfreerdp.exp
Normal file
1
test/completion/xfreerdp.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions xfreerdp
|
20
test/lib/completions/iscsiadm.exp
Normal file
20
test/lib/completions/iscsiadm.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "iscsiadm --mode "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
28
test/lib/completions/xfreerdp.exp
Normal file
28
test/lib/completions/xfreerdp.exp
Normal 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
|
Loading…
x
Reference in New Issue
Block a user