about summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-08-22 10:30:08 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-08-22 10:30:08 +0000
commit726b13a3a3f0f514e2d355f3de892e48ac873926 (patch)
tree8e871225b950a1193562c1d0e8cdd79e25824702 /Completion/Unix/Command
parent6bbad942fe9c57ea61655faf583c48898a7bed2d (diff)
downloadzsh-726b13a3a3f0f514e2d355f3de892e48ac873926.tar.gz
zsh-726b13a3a3f0f514e2d355f3de892e48ac873926.tar.xz
zsh-726b13a3a3f0f514e2d355f3de892e48ac873926.zip
18959: improve _perforce global option handling again
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_perforce9
1 files changed, 7 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_perforce b/Completion/Unix/Command/_perforce
index afadda4af..6891d6ba6 100644
--- a/Completion/Unix/Command/_perforce
+++ b/Completion/Unix/Command/_perforce
@@ -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 :