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
Some justifications for adding --files an alias for -f:
--files is more readable for scripting
--files could be easier to remember. Lot of CLI tools also use -f for "force".
For compatibility with rg. Even if you don't user ripgrep directly, it's a favorite choice of AI coding agents, so increasing number of people are seeing rg syntax scroll by, including --files.
It's backwards compatible.
--files is unlikely to be used for anything other than an anlias
for -f in the future, so it's likely forward-compatible, too.
(I'm not suggesting adding any /further/ compatible with rg, only that's nice to align new flags with /something/)
I call YAGNI here-- rg clearly did by not implementing it at all (rg --files | rg 'PATTERN' works), and I apparently did because I forgot the flag existed. I'd probably also use ack --files | ack 'PATTERN' myself, as I need it rarely I can accomplish the same functionality easily with features I /do/ remember.
So if anything, I'd go the opposite direction with -g and remove it in a future breaking change release.
Because it's rarely used and there's an easy alternative: ack --files | ack 'PATTERN'
But that conversation is out of scope here. The direct question was whether to add a long-files flag for -g.
Personally, I wouldn't because I expect -g is rarely used. Unless there's another newer grep-like tool it would help compatibility with. rg at least doesn't have a flag like that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some justifications for adding --files an alias for
-f:--filesis more readable for scripting--filescould be easier to remember. Lot of CLI tools also use-ffor "force".rg. Even if you don't user ripgrep directly, it's a favorite choice of AI coding agents, so increasing number of people are seeingrgsyntax scroll by, including--files.--filesis unlikely to be used for anything other than an anliasfor
-fin the future, so it's likely forward-compatible, too.(I'm not suggesting adding any /further/ compatible with
rg, only that's nice to align new flags with /something/)