summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2007-10-31 00:35:36 +0000
committerClint Adams <clint@users.sourceforge.net>2007-10-31 00:35:36 +0000
commit63e7d1d92012ad274c840f97e1a0bbe5a02a2367 (patch)
treebb1fc0bcb5bc63d69bff9a133f6e190635836307 /Completion/Unix/Command
parent2ab1bf71c6cdbc87545788add68d87a90baa5713 (diff)
downloadzsh-63e7d1d92012ad274c840f97e1a0bbe5a02a2367.tar.gz
zsh-63e7d1d92012ad274c840f97e1a0bbe5a02a2367.tar.xz
zsh-63e7d1d92012ad274c840f97e1a0bbe5a02a2367.zip
24039: cope with FreeBSD cut in addition to GNU cut.
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_cut73
1 files changed, 42 insertions, 31 deletions
diff --git a/Completion/Unix/Command/_cut b/Completion/Unix/Command/_cut
index 89fd24f38..7faad9d89 100644
--- a/Completion/Unix/Command/_cut
+++ b/Completion/Unix/Command/_cut
@@ -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 @@ _arguments \
         '--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