summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorFabian Klötzl <fabian@kloetzl.info>2017-07-13 11:19:14 +0200
committerOliver Kiddle <opk@zsh.org>2017-07-14 12:07:49 +0200
commit4a63a1793af5f3046af6a77db8aeeece523ebc61 (patch)
tree2f2b09ecd0dd02f8fe7c67b4c0435e539983c2bc /Completion
parent76a4a5ed3cc11d546897b69498905566326f3f26 (diff)
downloadzsh-4a63a1793af5f3046af6a77db8aeeece523ebc61.tar.gz
zsh-4a63a1793af5f3046af6a77db8aeeece523ebc61.tar.xz
zsh-4a63a1793af5f3046af6a77db8aeeece523ebc61.zip
41414: fix for commas used in exclusion lists
also missing escape for _gcc and --no-index option for git diff
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Linux/Command/_iptables4
-rw-r--r--Completion/Unix/Command/_gcc2
-rw-r--r--Completion/Unix/Command/_git9
3 files changed, 11 insertions, 4 deletions
diff --git a/Completion/Linux/Command/_iptables b/Completion/Linux/Command/_iptables
index 8f990030c..4178a1a2e 100644
--- a/Completion/Linux/Command/_iptables
+++ b/Completion/Linux/Command/_iptables
@@ -47,7 +47,7 @@ case ${prev[${prev[(I)-p|--protocol]}+1]}; in
 esac
 
 case ${prev[${prev[(I)-j|--jump]}+1]}; in
-  DNAT) args+=( '(--to,--to-destination)'{--to,--to-destination}':address:_users-ports' ) ;;
+  DNAT) args+=( '(--to --to-destination)'{--to,--to-destination}':address:_users-ports' ) ;;
   DSCP)
     args+=(
       '--set-dscp[set the DSCP field]:value'
@@ -67,7 +67,7 @@ case ${prev[${prev[(I)-j|--jump]}+1]}; in
   MARK) args+=( '--set-mark[set fwmark in packet]:number' ) ;;
   REDIRECT|MASQUERADE) args+=( '--to-ports[port (range) to map to]:port range:_ports' ) ;;
   REJECT) args+=( '--reject-with[drop packet and send reply]:reject type:->reject-types' ) ;;
-  SNAT) args+=( '(--to,--to-source)*'{--to,--to-source}'[specify address to map source to]:address:_users-ports' ) ;;
+  SNAT) args+=( '(--to --to-source)*'{--to,--to-source}'[specify address to map source to]:address:_users-ports' ) ;;
   TCPMSS)
     args+=(
       '--set-mss[explicitly set MSS option]:value'
diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc
index e188c7e9f..28a2ccbda 100644
--- a/Completion/Unix/Command/_gcc
+++ b/Completion/Unix/Command/_gcc
@@ -428,7 +428,7 @@ args+=(
   '-Wdisabled-optimization[Warn when an optimization pass is disabled]'
   '-Wdiv-by-zero[Warn about compile-time integer division by zero]'
   '-Wdouble-promotion[Warn about implicit conversions from "float" to "double"]'
-  '-Weffc++[Warn about violations of Effective C++ style rules]'
+  '-Weffc\+\+[Warn about violations of Effective C++ style rules]'
   '-Wempty-body[Warn about an empty body in an if or else statement]'
   '-Wendif-labels[Warn about stray tokens after #elif and #endif]'
   '-Wenum-compare[Warn about comparison of different enum types]'
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index dcf1f639c..aacd3bfd7 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -756,7 +756,8 @@ _git-diff () {
     $diff_options \
     '(--exit-code)--quiet[disable all output]' \
     $diff_stage_options \
-    '(--cached --staged)'{--cached,--staged}'[show diff between index and named commit]' \
+    '(--cached --staged)--no-index[show diff between two paths on the filesystem]' \
+    '(--cached --staged --no-index)'{--cached,--staged}'[show diff between index and named commit]' \
     '(-)--[start file arguments]' \
     '*:: :->from-to-file' && ret=0
 
@@ -774,6 +775,12 @@ _git-diff () {
         return ret
       fi
 
+      # If "--no-index" was given, only file paths need to be completed.
+      if [[ -n ${opt_args[(I)--no-index]} ]]; then
+        _alternative 'files::_files' && ret=0
+        return ret
+      fi
+
       # Otherwise, more complex conditions need to be checked.
       case $CURRENT in
         (1)