1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-17 00:31:09 +02:00

18959: improve _perforce global option handling again

This commit is contained in:
Peter Stephenson 2003-08-22 10:30:08 +00:00
parent 6bbad942fe
commit 726b13a3a3
2 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2003-08-22 Peter Stephenson <pws@csr.com>
* 18959: Completion/Unix/Command/_perforce: improve global
option handling again; completing global options themselves
was infelicitous.
2003-08-21 Peter Stephenson <pws@csr.com>
* 18958: Completion/Unix/Command/_perforce: improved option

View file

@ -273,8 +273,11 @@ _perforce() {
# end of the arguments list, anyway.
for (( i = 2; i < CURRENT; i++ )); do
if [[ $words[i] = -[$argopts_pass$argopts_ignore] ]]; then
# word with following argument
if [[ $words[i] = -[$argopts_pass] ]]; then
# word with following argument --- check this
# is less than the current word, else we are completing
# this and shouldn't pass it down
if [[ $(( i + 1 )) -lt $CURRENT && \
$words[i] = -[$argopts_pass] ]]; then
_perforce_global_options+=(${words[i,i+1]})
fi
(( i++ ))
@ -912,6 +915,8 @@ _perforce_groups() {
_perforce_hosts_ports() {
if compset -P '*:'; then
_ports
local expl
_wanted ports expl port compadd "$@" 1666
else
# is this -q-able?
_hosts -S :