1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-04-08 16:53:58 +02:00
Andrew Gallant 31d3e24130
args: prevent panicking in 'rg -h | rg'
Previously, we relied on clap to handle printing either an error
message, or --help/--version output, in addition to setting the exit
status code. Unfortunately, for --help/--version output, clap was
panicking if the write failed, which can happen in fairly common
scenarios via a broken pipe error. e.g., `rg -h | head`.

We fix this by using clap's "safe" API and doing the printing ourselves.
We also set the exit code to `2` when an invalid command has been given.

Fixes #1125 and partially addresses #1159
2019-01-26 14:39:40 -05:00
..
2019-01-26 13:40:12 -05:00
2018-08-20 07:10:19 -04:00
2019-01-26 12:34:28 -05:00
2018-08-21 23:05:52 -04:00