Enhanced shell completion

Labels: Easy pick area/cli enhancement good first issue help wanted

Timeline

Michael Muré (MichaelMure) opened

Cobra, the library used to implement the CLI commands also generate the shell completion scripts, for bash, zsh, fish and powershell. This completion scripts are based on the description of each commands (living in https://github.com/MichaelMure/git-bug/tree/master/commands).

At the moment, those completion works decently, completing command names and flags. However it would be possible to do better. By teaching cobra (see https://github.com/spf13/cobra/blob/master/shell_completions.md#customizing-completions) about what is expected, it should be possible to:

  • disable the default completion showing files when it's not appropriate
  • complete based on git-bug specific terms (git bug ls [tab][tab] would also complete with query qualifiers)
  • complete based on git-bug specific data (git bug show [tab][tab] would complete with bug Ids, possibly with the bug title)

Michael Muré (MichaelMure) added label enhancement

Michael Muré (MichaelMure) added label help wanted

Michael Muré (MichaelMure) added label good first issue

Michael Muré (MichaelMure) added label area/cli

Michael Muré (MichaelMure) added label Easy pick

Ogguz (Ogguz) commented

I want to work on this

Michael Muré (MichaelMure) commented

Yes please!

Johannes Altmanninger (krobelus) commented

As a first step, I have added bug ID completions. They work well in fish, I'm not sure how to make completions work in zsh.

Leo Olofsson (TheNerdyHamster) commented

What is the status on this issue? I would be interested to continue on it, if its not completed

Michael Muré (MichaelMure) closed the bug