Skip to content

Enhanced shell completion #493

Closed
Closed

Description

@MichaelMure

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)

Activity

  1. Ogguz commented on Jan 19, 2021

    @Ogguz

    I want to work on this

  2. MichaelMure commented on Jan 19, 2021

    @MichaelMure
    ContributorAuthor

    Yes please!

  3. added a commit that references this issue on Jan 24, 2021
  4. krobelus commented on Jan 24, 2021

    @krobelus
    Contributor

    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.

  5. added a commit that references this issue on Feb 10, 2021
    6215930
  6. TheNerdyHamster commented on May 31, 2021

    @TheNerdyHamster

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

  7. added a commit that references this issue on Aug 1, 2021
    b2effa9
  8. added a commit that references this issue on Mar 2, 2022
    715a8eb
  9. added a commit that references this issue on May 1, 2022
    bc6ba02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliRelates to the CLI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions