Skip to content

Add --files alias for -f - #402

Open
markstos wants to merge 1 commit into
beyondgrep:devfrom
markstos:add-files-flag
Open

Add --files alias for -f#402
markstos wants to merge 1 commit into
beyondgrep:devfrom
markstos:add-files-flag

Conversation

@markstos

@markstos markstos commented Aug 4, 2026

Copy link
Copy Markdown

Some justifications for adding --files an alias for -f:

  1. --files is more readable for scripting
  2. --files could be easier to remember. Lot of CLI tools also use -f for "force".
  3. 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.
  4. It's backwards compatible.
  5. --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/)

@petdance

petdance commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Does it make sense to make one for -g as well?

@markstos

markstos commented Aug 4, 2026

Copy link
Copy Markdown
Author

Does it make sense to make one for -g as well?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants