Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better documentation for persisting --type-add/--type-clear using config files. #1571

Closed
llamasoft opened this issue May 7, 2020 · 1 comment
Labels
doc An issue with or an improvement to documentation. enhancement An enhancement to the functionality of the software.

Comments

@llamasoft
Copy link

A while back I discovered that ripgrep supports a --type-add option and I was quite excited. I find myself using the same glob patterns pretty regularly, so having a way to define common patterns seemed like it would save me a tremendous amount of time... until I saw that "Type settings are NOT persisted".
I found this rather disappointing because it meant that --type-add would only ever save time if I wrapped rg in an alias or function.
It wasn't until much later (today in fact!) that I saw that ripgrep supports configuration files. This effectively means that I can persist my type definitions.

Given the severe limitation of type definitions not being automatically persisted, I would strongly suggest updating the help text/manpages of --type-add and --type-clear to also mention the existence of using a configuration file as a workaround. Yes, the configuration file guide uses --type-add as an example, but most users may not realize that a configuration file solution exists if something doesn't point them directly to it.

In summary, I suggest changing this line:

Note that this MUST be passed to every invocation of ripgrep. Type settings are NOT persisted.

Into something like this:

Note that this MUST be passed to every invocation of ripgrep. Type settings are NOT persisted. See CONFIGURATION FILES for a workaround.

@BurntSushi
Copy link
Owner

Sounds good. For such a small change, I'd encourage folks to submit a PR for it.

@BurntSushi BurntSushi added doc An issue with or an improvement to documentation. enhancement An enhancement to the functionality of the software. labels May 7, 2020
BurntSushi added a commit that referenced this issue May 8, 2020
This clarifies that persistence is possible via a configuration file.

Fixes #1571
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc An issue with or an improvement to documentation. enhancement An enhancement to the functionality of the software.
Projects
None yet
Development

No branches or pull requests

2 participants