I haven't looked closely at the internals recently, so I'd like to leave that part to you. But by exposing a model of the command structure in #106 (responding to #104), I was able to write some re-usable code that provides shell auto-completion for Bash and Zsh. (I haven't attempted Fish or Powershell yet, but it'd be awesome if someone who knows those shells better than I could contribute those bits).
I haven't looked closely at the internals recently, so I'd like to leave that part to you. But by exposing a model of the command structure in #106 (responding to #104), I was able to write some re-usable code that provides shell auto-completion for Bash and Zsh. (I haven't attempted Fish or Powershell yet, but it'd be awesome if someone who knows those shells better than I could contribute those bits).
Here is the code. MIT licensed. Please steal and adapt. https://gist.github.com/skyzyx/149caddbf0c949da58618cb03b08e4d9
After compiling down to a single binary (e.g.,
mycmd
), I'm able to setup autocompletion thusly:Bash:
Zsh: