legendary icon indicating copy to clipboard operation
legendary copied to clipboard

Please add bash-completion

Open StefanLobbenmeier opened this issue 4 years ago • 4 comments

Would be nice if we could tab to complete commands and names of games

StefanLobbenmeier avatar Oct 01 '20 15:10 StefanLobbenmeier

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.

derrod avatar Oct 01 '20 21:10 derrod

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.

StefanLobbenmeier avatar Oct 02 '20 09:10 StefanLobbenmeier

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

theAkito avatar Oct 02 '20 15:10 theAkito

https://github.com/derrod/legendary/pull/118

legendofmiracles avatar Oct 11 '20 07:10 legendofmiracles