Commit Graph

12 Commits

Author SHA1 Message Date
Marc Khouzam d4040ad8db
Allow user to add completion for powershell alias ()
When a user has an alias in powershell, she will need to register that
alias for completion.  To make that possible, we store the completion
logic into a scriptblock variable which can easily be accessed by the
user to register aliases.

For example, if the user defines an alias for `helm`:
   PS> sal h helm
she will need to register the alias like so:
   PS> Register-ArgumentCompleter -CommandName 'h' -ScriptBlock $__helmCompleterBlock

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2022-10-03 13:06:04 -04:00
Unai Martinez-Corral 6d978a911e
add missing license headers () 2022-09-16 07:55:56 -04:00
Marc Khouzam f464d6c82e
Add Active Help support () 2022-06-15 20:08:16 -04:00
Stefan Weil 1854bb5c96
Fix some typos (mostly found by codespell) ()
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-12-07 16:06:52 -07:00
Sebastiaan van Stijn 507caf5ac8
completions: fix mixed tab/spaces indentation ()
These templates use 4 spaces for indentation, but some lines
used tabs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-12-07 15:57:57 -07:00
tamo 4590150168
Correcting misspelled words ()
* Correcting Misspelled Words
* grammar fixes
2021-05-10 17:19:33 -06:00
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