Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: minor fix for _uniq
- X-seq: zsh-workers 30658
- From: "Jun T." <takimoto-j@xxxxxxxxxxxxxxxxx>
- To: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: PATCH: minor fix for _uniq
- Date: Wed, 5 Sep 2012 22:35:24 +0900
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Minor changes to the completion for 'uniq'.
Added an option -i for MacOSX (darwin) and freebsd,
and options -z/--zero-terminated for Gnu version.
I could not find options -t/--separator and -W/--check-fields in
my Linux boxes, but I didn't remove them.
Index: Completion/Unix/Command/_uniq
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_uniq,v
retrieving revision 1.1
diff -u -r1.1 _uniq
--- Completion/Unix/Command/_uniq 23 Feb 2004 17:03:31 -0000 1.1
+++ Completion/Unix/Command/_uniq 5 Sep 2012 13:28:26 -0000
@@ -13,12 +13,17 @@
'(-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[@]" \
Messages sorted by:
Reverse Date,
Date,
Thread,
Author