Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#448465: zsh completion for coreutils cut
- X-seq: zsh-workers 24039
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: "Dr. Markus Waldeck" <waldeck@xxxxxx>
- Subject: Re: Bug#448465: zsh completion for coreutils cut
- Date: Tue, 30 Oct 2007 20:12:53 -0400
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <20071030200829.208660@xxxxxxx>
- Mail-followup-to: "Dr. Markus Waldeck" <waldeck@xxxxxx>, zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20071029135638.GA27117@xxxxxxxxxxx> <20071030060305.273140@xxxxxxx> <20071030171505.GA3315@xxxxxxxxxxx> <20071030200829.208660@xxxxxxx>
On Tue, Oct 30, 2007 at 09:08:29PM +0100, Dr. Markus Waldeck wrote:
> _pick_variant requires that a program is verbose.
>
> Please add the following lines.
>
> if _pick_variant gnu="Free Soft" unix --version; then
> case $LANG in
> ...
> '--version['$_cut_args[version]']'
> fi
The alternate form is a poorly-done rendition for FreeBSD cut.
Index: Completion/Unix/Command/_cut
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_cut,v
retrieving revision 1.1
diff -u -r1.1 _cut
--- Completion/Unix/Command/_cut 29 Oct 2007 14:00:32 -0000 1.1
+++ Completion/Unix/Command/_cut 31 Oct 2007 00:11:06 -0000
@@ -2,38 +2,39 @@
typeset -A _cut_args
-case $LANG in
- (de_DE.UTF-8)
- _cut_args=(
- bytes "nur diese Bytes ausgeben"
- characters "nur diese Zeichen ausgeben"
- delimiter "Delimiter anstelle von Tabulator als Trenner benutzen"
- fields "nur diese Felder und alle Zeilen OHNE Trennzeichen ausgeben"
- n "(ignoriert)"
- complement "das Komplement der Menge der gewählten Bytes, Zeichen oder Felder bilden"
- only-delimited "keine Zeilen ausgeben, die keinen Trenner enthalten"
- output-delimiter "Zeichenkette als Ausgabetrennzeichen benutzen"
- help "diese Hilfe anzeigen und beenden"
- version "Versionsinformation anzeigen und beenden"
- )
- ;;
- (*)
- _cut_args=(
- bytes "select only these bytes"
- characters "select only these characters"
- delimiter "use DELIM instead of TAB for field delimiter"
- fields "select only these fields and lines whitout the delimiter character"
- n "(ignored)"
- complement "complement the set of selected bytes, characters or fields"
- only-delimited "do not print lines not containing delimiters"
- output-delimiter "use STRING as the output delimiter"
- help "display this help and exit"
- version "output version information and exit"
- )
- ;;
-esac
+if _pick_variant gnu="Free Soft" unix --version; then
+ case $LANG in
+ (de_DE.UTF-8)
+ _cut_args=(
+ bytes "nur diese Bytes ausgeben"
+ characters "nur diese Zeichen ausgeben"
+ delimiter "Delimiter anstelle von Tabulator als Trenner benutzen"
+ fields "nur diese Felder und alle Zeilen OHNE Trennzeichen ausgeben"
+ n "(ignoriert)"
+ complement "das Komplement der Menge der gewählten Bytes, Zeichen oder Felder bilden"
+ only-delimited "keine Zeilen ausgeben, die keinen Trenner enthalten"
+ output-delimiter "Zeichenkette als Ausgabetrennzeichen benutzen"
+ help "diese Hilfe anzeigen und beenden"
+ version "Versionsinformation anzeigen und beenden"
+ )
+ ;;
+ (*)
+ _cut_args=(
+ bytes "select only these bytes"
+ characters "select only these characters"
+ delimiter "use DELIM instead of TAB for field delimiter"
+ fields "select only these fields and lines whitout the delimiter character"
+ n "(ignored)"
+ complement "complement the set of selected bytes, characters or fields"
+ only-delimited "do not print lines not containing delimiters"
+ output-delimiter "use STRING as the output delimiter"
+ help "display this help and exit"
+ version "output version information and exit"
+ )
+ ;;
+ esac
-_arguments \
+ _arguments \
'(--bytes -b)'{--bytes=,-b}'['$_cut_args[bytes]']' \
'(--characters -c)'{--characters=,-c}'['$_cut_args[characters]']' \
'(--delimiter -d)'{--delimiter=,-d}'['$_cut_args[delimiter]']' \
@@ -44,3 +45,13 @@
'--output-delimiter['$_cut_args[output-delimiter]']' \
'--help['$_cut_args[help]']' \
'--version['$_cut_args[version]']'
+else
+ _arguments \
+ '-b[list specifies byte positions]:list:' \
+ '-c[list specifies character positions]:list:' \
+ '-d[use alternate delimeter]:delimeter:' \
+ '-f[list specifies fields]:list:' \
+ '-n[do not split multi-byte characters]' \
+ '-s[suppress lines with no delimeters]' \
+ '*:file:_files'
+fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author