Skip to content

Commit

Permalink
powershell: register with list
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Nov 8, 2024
1 parent 633eaba commit b0fd67e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/shell/powershell/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ Function _%v_completer {
$completions
}
Register-ArgumentCompleter -Native -CommandName '%v' -ScriptBlock (Get-Item "Function:_%v_completer").ScriptBlock
%vRegister-ArgumentCompleter -Native -CommandName '%v.exe' -ScriptBlock (Get-Item "Function:_%v_completer").ScriptBlock
Register-ArgumentCompleter -Native -ScriptBlock (Get-Item "Function:_%v_completer").ScriptBlock -CommandName '%v'%v,'%v.exe'
`

// Snippet creates the powershell completion script.
func Snippet(cmd *cobra.Command) string {
prefix := "# "
prefix := " # "
if runtime.GOOS == "windows" {
prefix = ""
}
Expand All @@ -71,6 +70,5 @@ func Snippet(cmd *cobra.Command) string {
cmd.Name(),
cmd.Name(),
prefix,
cmd.Name(),
cmd.Name())
}

0 comments on commit b0fd67e

Please sign in to comment.