You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
awk: --lint, --profile, --debug, --dump-variables, --pretty-print take the program text as their value #181
These gawk options take an optional value, which must be attached: --lint=fatal, -Lfatal, --profile=file. uutils awk (clap with num_args = 0..=1) also takes the next argument, so awk --lint 'PROGRAM'
treats the program as the option value.
Reproduction
Rust (incorrect)
$ ./target/release/awk --lint 'BEGIN { print "hi" }'
error: invalid value 'BEGIN { print "hi" }'for'--lint [<LINT>]'
[possible values: basic, fatal, invalid, no-ext]
# Exit code: 1
$ ./target/release/awk --profile 'BEGIN { print "hi" }'
error: the following required arguments were not provided:
<CODE>
GNU (correct)
$ gawk --lint 'BEGIN { print "hi" }'
hi
$ gawk --profile 'BEGIN { print "hi" }'
hi
(Run it in a temporary directory: GNU writes awkprof.out / awkvars.out. --pretty-print is left out on purpose: it writes the program and does not
run it.)
Exposed by the GNU awk test suite: modifiers (once the harness sets AWKPROG,
see INDEX.md); every --lint test once lint warnings exist.
Activity