ripgrep icon indicating copy to clipboard operation
ripgrep copied to clipboard

Include valid values in --help

Open smprather opened this issue 1 year ago • 2 comments

There are many ripgrep options that take an = value. Can the help be improved to show the list of valid values? The error message should do the same. As it is now, all I get is this. Thanks @BurntSushi !

$ rg --color
missing value for flag --color: missing argument for option '--color'

$ rg --help  ### Edit: this should have been -h ###
...
--color=WHEN                    When to use color.

I had to search the repo to find the valid values. image

smprather avatar Dec 20 '23 00:12 smprather

The values for --color are in the --help output. The output you've pasted looks like it's from the -h output even though you have rg --help as the command you ran.

BurntSushi avatar Dec 20 '23 01:12 BurntSushi

You are correct. I editted the OP to correct.

I am used to -h and --help being aliases. In fact, I can't recall a case where that wasn't true.

I would still request you add the valid values to the error message. But I'll leave that up to you. I'll leave it open. Feel free to close if you want to take a pass.

Thanks for this incredible tool. I use it literally 100 times/day!

smprather avatar Dec 20 '23 05:12 smprather