legendary
legendary copied to clipboard
Please add bash-completion
Would be nice if we could tab to complete commands and names of games
Bash completion for commands would be possible, I don't think it would work for games since the bash completion file would not contain that information or would have to be regenerated every time there is new game information available.
Hmm looking at the bash-completion of docker / pacman it should be possible to also use the bash-completion for dynamic content like names of containers, packages, or games on epic games. I have never created such a completion script before though, so I don't know how these are doing it.
would have to be regenerated every time there is new game information available.
This shouldn't be an issue, at all. Generations could be triggered by hooks on installation and removal of games.
I've researched a bit on Bash Completion and it seems like it doesn't need to be generated, at all. The completion just needs to execute a function which looks in the game directory and lists its contents. This should be easily implemented.
https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html#Programmable-Completion
https://github.com/derrod/legendary/pull/118