git-machete icon indicating copy to clipboard operation
git-machete copied to clipboard

Consider autogenerating completion by `argcomplete` or `shtab`

Open PawelLipski opened this issue 4 years ago • 1 comments

Esp. to implement https://github.com/VirtusLab/git-machete/issues/119 and https://github.com/VirtusLab/git-machete/issues/290

Some early attempt for both has been done by @kgadek, but the generated scripts don't seem nowhere near complete :/

PawelLipski avatar Oct 18 '21 09:10 PawelLipski

TBH I've barely touched the topic. Glimpsed over shtab & argcomplete, tried to "just attach" their machinery on cli.create_cli_parser. More work on that needed.

There's gonna be one more challenge: I don't think such tools would support machete being a git subcommand. In other words: this is not a completion for git-machete nor machete, but for git machete. And that could cause trouble:

  • for bash/zsh: needs to generate _git_machete() / _git-machete() — nb.: prefixed with git,
  • for fish: needs to call complete -c git -n "__fish_seen_subcommand_from machete" ….

kgadek avatar Oct 18 '21 10:10 kgadek