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

add bash / zsh / fish shell completion for flags #226

Open
j-lakeman opened this issue May 16, 2024 · 3 comments
Open

add bash / zsh / fish shell completion for flags #226

j-lakeman opened this issue May 16, 2024 · 3 comments

Comments

@j-lakeman
Copy link

Would be cool if flags like --rga-adapters could be autocompleted upon pressing TAB. This would increase the ease of use of this already great application lots IMHO.

@Konfekt
Copy link

Konfekt commented May 23, 2024

You could give https://github.com/sigoden/argc-completions/blob/main/completions/rga.sh a whirl

@j-lakeman
Copy link
Author

Cheers, that's awesome!
However I still believe the application itself should provide that, just like ripgrep does.

@Konfekt
Copy link

Konfekt commented May 28, 2024

Rga's additional parameters seem straight-forward, so something like adding the following lines to rg's zsh completion (where the patch uses rg 0.13.0) seems sufficient:

0a1
> 
326c327,344
<   )
---
> 
>     + rga
>     '--rga-accurate[Use more accurate but slower matching by mime type]' \
>     '--rga-no-cache[Disable caching of results]' \
>     '--rga-list-adapters[List all known adapters]' \
>     '--rga-no-prefix-filenames[Do not prefix lines of files within archive with the path inside the archive]' \
>     '--rga-print-config-schema[Print the JSON Schema of the configuration file]' \
>     '--rg-help[Show help for ripgrep itself]' \
>     '--rg-version[Show version of ripgrep itself]' \
>     '-V[Prints version information]' \
>     '--version[Prints version information]' \
>     '--rga-adapters=[Change which adapters to use and in which priority order (descending)]:adapters' \
>     '--rga-cache-compression-level=[ZSTD compression level to apply to adapter outputs before storing in cache db]:compression-level' \
>     '--rga-config-file=[Path to configuration file]:config-file-path' \
>     '--rga-max-archive-recursion=[Maximum nestedness of archives to recurse into]:max-archive-recursion' \
>     '--rga-cache-max-blob-len=[Max compressed size to cache]:max-blob-len' \
>     '--rga-cache-path=[Path to store cache db]:path'
>     )

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

No branches or pull requests

2 participants