summary refs log tree commit diff
path: root/Completion/Unix/Command/_cut
blob: 1024c20a71a867290d30a6e2bcdddeae78b316d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#compdef cut

typeset -A _cut_args

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\u00e4hlten 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 without 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 \
    '(--bytes -b)'{--bytes=,-b+}'['$_cut_args[bytes]']:list' \
    '(--characters -c)'{--characters=,-c+}'['$_cut_args[characters]']:list' \
    '(--delimiter -d)'{--delimiter=,-d+}'['$_cut_args[delimiter]']:delimiter' \
    '(--fields -f)'{--fields=,-f+}'['$_cut_args[fields]']:list' \
    '-n['$_cut_args[n]']' \
    '--complement['$_cut_args[complement]']' \
    '(--only-delimited -s)'{--only-delimited,-s}'['$_cut_args[only-delimited]']' \
    '--output-delimiter=['$_cut_args[output-delimiter]']:delimiter' \
    '(- *)--help['$_cut_args[help]']' \
    '(- *)--version['$_cut_args[version]']' \
    '*:file:_files'
else
  _arguments \
    '-b[list specifies byte positions]:list:' \
    '-c[list specifies character positions]:list:' \
    '-d[use alternate delimiter]:delimiter' \
    '-f[list specifies fields]:list:' \
    '-n[do not split multi-byte characters]' \
    '-s[suppress lines with no delimiters]' \
    '*:file:_files'
fi