about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-09-05 14:54:39 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-09-05 14:54:39 +0000
commit1f5ef83f0f3aea0597ef3db7a05970420646bfdc (patch)
tree3f2d8bf457dbc219aa8d9e99490fd07302464f06
parenta090655b16596b232f2e2781b7d80e4ead53589c (diff)
downloadzsh-1f5ef83f0f3aea0597ef3db7a05970420646bfdc.tar.gz
zsh-1f5ef83f0f3aea0597ef3db7a05970420646bfdc.tar.xz
zsh-1f5ef83f0f3aea0597ef3db7a05970420646bfdc.zip
Jun T.: 30658: complete more uniq options
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Unix/Command/_uniq7
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 853977983..ff8c8f666 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2012-09-05  Peter Stephenson  <pws@csr.com>
 
+	* Jun T.: 30658: Completion/Unix/Command/_uniq: more options.
+
 	* Silas Silva: users/17223: Completion/Unix/Command/_lp:
 	page-ranges option.
 
@@ -135,5 +137,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5714 $
+* $Revision: 1.5715 $
 *****************************************************
diff --git a/Completion/Unix/Command/_uniq b/Completion/Unix/Command/_uniq
index be58fd775..dcd7a6f49 100644
--- a/Completion/Unix/Command/_uniq
+++ b/Completion/Unix/Command/_uniq
@@ -13,12 +13,17 @@ args=(
   '(-u --unique)'{-u,--unique}'[only print unique lines]'
   '(-w --check-chars)'{-w,--check-chars=}'[specify maximum number of characters to compare]:characters'
   '(-W --check-fields)'{-W,--check-fields=}'[specify maximum number of fields to compare]:fields'
+  '(-z --zero-terminated)'{-z,--zero-terminated}'[delimit lines with null character, not newline]'
   '(- *)--help[display help information]'
   '(- *)--version[display version information]'
 )
 
 if ! _pick_variant gnu=Free\ Soft unix --version; then
-  args=( ${(M)args:#(|\*)(|\(*\))-[cdufs]*} )
+  local optchars="cdufs"
+  if [[ "$OSTYPE" == (darwin|freebsd)* ]]; then
+    optchars="${optchars}i"
+  fi
+  args=( ${(M)args:#(|\*)(|\(*\))-[$optchars]*} )
 fi
 
 _arguments "$args[@]" \