Skip to content

Add hidden winget complete command to enable tab-completion #331

Closed

Description

Description of the new feature/enhancement

The dotnet cli tool from the .NET Core SDK has a hidden complete command that works like this:

PS> dotnet complete --position 2 "re"
remove
restore
store

This can be hooked into environments like PowerShell to enable command/parameter completion for dotnet.exe e.g.:

Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock {
    param($wordToComplete, $commandAst, $cursorPosition)

    dotnet complete --position $cursorPosition $commandAst | ForEach-Object {
        [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
    }
}

Proposed technical implementation details (optional)

I would like to see winget implement a hidden complete command that would provide completions for top-level commands e.g.: install, show, source, search, hash, validate. And then for each command, it should provide parameter completions e.g. winget install --id Git.Git --s should return --source and --silent.

Activity

  1. added
    Issue-Feature
    on May 25, 2020
  2. ghost added
    Needs-Triage
    on May 25, 2020
  3. megamorf commented on May 25, 2020

    @megamorf

    Relates to #146.

  4. removed
    Needs-Triage
    on May 31, 2020
  5. added this to the milestone on May 31, 2020
  6. rkeithhill commented on Aug 27, 2020

    @rkeithhill
    Author

    Closing issue as this has been released, see the doc for more details.

  7. modified the milestones: , v1.0 - Windows Package Manager on May 4, 2021
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

    Issue-Feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions