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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#compdef awkrs aw
# Zsh completion for awkrs — awk-compatible pattern-directed scanning and processing
_awkrs_lint_values() {
local -a vals=(
'fatal:Treat lint warnings as fatal errors'
'invalid:Warn about invalid constructs'
'no-ext:Warn about non-POSIX extensions'
)
_describe 'lint level' vals
}
_awkrs() {
local curcontext="$curcontext" ret=1
_arguments -s -S \
'-f+[Read program from file]:program file:_files' \
'--file=[Read program from file]:program file:_files' \
'-F+[Set field separator]:field separator:' \
'--field-separator=[Set field separator]:field separator:' \
'*-v+[Assign variable before execution]:var=val:' \
'*--assign=[Assign variable before execution]:var=val:' \
'*-e+[Program source text]:program text:' \
'*--source=[Program source text]:program text:' \
'*-i+[Include awk source file]:include file:_files' \
'*--include=[Include awk source file]:include file:_files' \
'-b[Treat characters as bytes]' \
'--characters-as-bytes[Treat characters as bytes]' \
'-c[Use traditional POSIX awk]' \
'--traditional[Use traditional POSIX awk]' \
'-C[Print copyright info]' \
'--copyright[Print copyright info]' \
'-d+[Dump variables to file]:dump file:_files' \
'--dump-variables=[Dump variables to file]:dump file:_files' \
'-D+[Debug mode with file]:debug file:_files' \
'--debug=[Debug mode with file]:debug file:_files' \
'-E+[Execute program from file then exit]:exec file:_files' \
'--exec=[Execute program from file then exit]:exec file:_files' \
'-g[Generate .pot file for i18n]' \
'--gen-pot[Generate .pot file for i18n]' \
'-I[Trace execution]' \
'--trace[Trace execution]' \
'-k[Enable CSV field parsing]' \
'--csv[Enable CSV field parsing]' \
'*-l+[Load shared library]:library name:' \
'*--load=[Load shared library]:library name:' \
'-L+[Lint level]:lint level:_awkrs_lint_values' \
'--lint=[Lint level]:lint level:_awkrs_lint_values' \
'-M[Enable arbitrary precision arithmetic]' \
'--bignum[Enable arbitrary precision arithmetic]' \
'-N[Use locale decimal point]' \
'--use-lc-numeric[Use locale decimal point]' \
'-n[Allow non-decimal input data]' \
'--non-decimal-data[Allow non-decimal input data]' \
'-o+[Pretty-print program to file]:output file:_files' \
'--pretty-print=[Pretty-print program to file]:output file:_files' \
'-O[Optimize program]' \
'--optimize[Optimize program]' \
'-p+[Profile to file]:profile file:_files' \
'--profile=[Profile to file]:profile file:_files' \
'-P[Strict POSIX mode]' \
'--posix[Strict POSIX mode]' \
'-r[Enable interval expressions in regexes]' \
'--re-interval[Enable interval expressions in regexes]' \
'-s[Disable optimizations]' \
'--no-optimize[Disable optimizations]' \
'-S[Sandbox mode (disable I/O redirections)]' \
'--sandbox[Sandbox mode (disable I/O redirections)]' \
'-t[Lint old-style awk constructs]' \
'--lint-old[Lint old-style awk constructs]' \
'*-W+[mawk-compatible option]:mawk option:(help usage version exec=)' \
'-j+[Thread count for internal pools (default 1)]:thread count:' \
'--threads=[Thread count for internal pools (default 1)]:thread count:' \
'--read-ahead=[Read-ahead queue depth (lines)]:queue depth:' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'*:input file:_files' \
&& ret=0
return ret
}
_awkrs "$@"