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
grep - an unknown option prints clap's error: ... block (and Usage: grep-usage) instead of grep: ... #214
For an unknown option GNU grep prints one line prefixed with the program name
(grep: unrecognized option '--frobnicate' or grep: invalid option -- 'j'), then Usage: grep [OPTION]... PATTERNS [FILE]... and Try 'grep --help' for more information. uu_grep prints clap's multi-line block that starts with error:, adds a tip:, and its
usage line is the unresolved placeholder Usage: grep-usage. The exit status (2) matches.
Scripts that derive the program name from the first PROG: of this message break. The GNU
test filename-lineno.pl does exactly that (it runs grep --no-such-option and keeps the text
before the first :), gets error, and then every sub-test runs a command called error
(exit 127). Once that is fixed the same test still fails on the known issues #179 and #185
and on the retry-limit panic.
Reproduction
Rust (incorrect)
$ ./target/release/grep --frobnicate x </dev/null
error: unexpected argument '--frobnicate' found
tip: to pass '--frobnicate' as a value, use '-- --frobnicate'
Usage: grep-usage
For more information, try '--help'.
# Exit code: 2
$ ./target/release/grep -j x </dev/null
error: unexpected argument '-j' found
...
Usage: grep-usage
...
# Exit code: 2
Activity
grep: format unknown option errors to match GNU grep
grep: format unknown option errors to match GNU grep
grep: format unknown option errors to match GNU grep
grep: format unknown option errors to match GNU grep
grep: format unknown option errors to match GNU grep
grep: format unknown option errors to match GNU grep