Skip to content

Powershell completion does not include descriptions #4084

@marckhouzam

Description

@marckhouzam

Describe the bug

Completion descriptions are used for zsh, fish and now bash thanks to #4028.
However, they are not used for Powershell although they are available from Cobra.

Steps to reproduce the behavior

  1. git checkout trunk; make
  2. pwsh
  3. bin/gh completion -s powershell | Out-String | Invoke-Expression
  4. bin/gh <TAB>
PS /Users/marckhouzam/git/cli> bin/gh <TAB>
actions     api         browse      config      help        pr          repo        secret      workflow
alias       auth        completion  gist        issue       release     run         ssh-key     co

There are no descriptions for the completions, unlike the other shells.

Expected vs actual behavior

Cobra provides support for descriptions of completions for Powershell which would yield, for example:

PS /Users/marckhouzam/git/cli> bin/gh <TAB>
actions     (Learn about working with GitHub actions)         issue       (Manage issues)
alias       (Create command shortcuts)                        pr          (Manage pull requests)
api         (Make an authenticated GitHub API request)        release     (Manage GitHub releases)
auth        (Login, logout, and refresh your authentication)  repo        (Create, clone, fork, and view repositories)
browse      (Open the repository in the browser)              run         (View details about workflow runs)
completion  (Generate shell completion scripts)               secret      (Manage GitHub secrets)
config      (Manage configuration for gh)                     ssh-key     (Manage SSH keys)
gist        (Manage gists)                                    workflow    (View details about GitHub Actions workflows)
help        (Help about any command)                          co

I will post a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions