Closed kbdharun closed 9 months ago
Use an external command
There's an option in the config to change the cache directory. We can't hard-code the path in the completion script.
Use a native Rust library
This is the current approach - generate completions automatically using clap_complete
. The downside of this is that everything the completion suggests has to be known at compile-time, so we can't use it either.
Parse and use our existing JSON index
That is certainly possible, but would require caching the index somewhere and using some kind of JSON parser in the completion script, which adds an extra dependency.
I think the best solution is to use the output of tldr --list-all
.
I think the best solution is to use the output of tldr --list-all.
Yeah, that would work too.
Currently, in
tlrc
v1.8.0 installed viabrew
, the autocompletion doesn't seem to support displaying page possibilities. i.e. If I typetldr aws
and press tab, the output should show all the possibilities foraws
subcommands.We support this feature in all our official clients. It would be great if
tlrc
supports it too.Ways to implement it
.md
pages in cache and display it in autocompletion.