summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-08-21 18:27:15 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-08-21 18:27:15 +0000
commit6bbad942fe9c57ea61655faf583c48898a7bed2d (patch)
treed61f6b46976420a79717a650424b83f18961ff3f /Completion/Unix/Command
parentd27da0dce045169cc7d5780a2a8a9365836cda38 (diff)
downloadzsh-6bbad942fe9c57ea61655faf583c48898a7bed2d.tar.gz
zsh-6bbad942fe9c57ea61655faf583c48898a7bed2d.tar.xz
zsh-6bbad942fe9c57ea61655faf583c48898a7bed2d.zip
18958: improved option handling for p4 change
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_perforce8
1 files changed, 6 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_perforce b/Completion/Unix/Command/_perforce
index 6803ad6da..afadda4af 100644
--- a/Completion/Unix/Command/_perforce
+++ b/Completion/Unix/Command/_perforce
@@ -1173,13 +1173,17 @@ _perforce_cmd_branches() {
 
 (( $+functions[_perforce_cmd_change] )) ||
 _perforce_cmd_change() {
+    local ctype
+    # Unless forcing or outputting, we don't
+    # complete committed changes since they can't be altered.
+    [[ ${words[(I)-*(f|o)*]} -eq 0 ]] && ctype=" -tp"
     _arguments -s : \
 	'(-o)-f[allow force by superuser]' \
 	'-s[joblist includes the fix status]' \
-	'(-o -i)-d[describe newly created pending change]' \
+	'(-o -i)-d[discard newly created pending change]' \
 	'(-d -i -f)-o[output specification to standard output]' \
 	'(-d -o)-i[read specification from standard input]' \
-	'(-i)1::change:_perforce_changes -tp'
+	"(-i)1::change:_perforce_changes$ctype"
 }