1
0
Fork 0
mirror of https://github.com/spf13/cobra synced 2025-05-14 09:17:18 +00:00
Commit graph

6 commits

Author SHA1 Message Date
Paul Holzinger
7223a997c8
powershell completion fix no file comp directive ()
Make sure to filter the returned completions before we check if
there are valid completions left.

Fixes 

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-05-03 10:25:30 -06:00
Paul Holzinger
ded486a867
Fix trailing whitespace in the powershell completion script ()
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-14 10:27:21 -07:00
Anthony Fok
07445ea179
Copyedit shell-completion related documentation 2021-02-09 14:08:42 -07:00
Unai Martinez-Corral
652c755d37
Use golangci-lint ()
Use golangci-lint. Repair warnings and errors resulting from linting.
2021-02-07 17:08:50 -07:00
Paul Holzinger
a4ab3fa09e
powershell completion with custom comp ()
The current powershell completion is not very capable.

Let's port it to the go custom completion logic to have a
unified experience accross all shells.

Powershell supports three different completion modes

- TabCompleteNext (default windows style - on each key press the next option is displayed)
- Complete (works like bash)
- MenuComplete (works like zsh)

You set the mode with `Set-PSReadLineKeyHandler -Key Tab -Function <mode>`

To keep it backwards compatible `GenPowerShellCompletion` will not display descriptions.
Use `GenPowerShellCompletionWithDesc` instead. Descriptions will only be displayed with
`MenuComplete` or `Complete`.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-12-29 07:57:32 -07:00
Jan Kuehle
21ccc7b307 Add basic PowerShell completions 2019-06-07 10:26:08 -04:00