From f43b653d17548a1b8f81034fc4a63034950e0da3 Mon Sep 17 00:00:00 2001 From: Mavaddat Javid <5055400+mavaddat@users.noreply.github.com> Date: Mon, 19 Jun 2023 16:56:55 -0400 Subject: [PATCH] Update powershell_completions.go Preliminary assignment before use --- powershell_completions.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/powershell_completions.go b/powershell_completions.go index 6929dbaa..1dad2039 100644 --- a/powershell_completions.go +++ b/powershell_completions.go @@ -287,7 +287,8 @@ foreach($__%[2]sCmd in $available%[2]s){ $__%[2]sAliases += Get-Alias | Where-Object { $_.Definition -eq ($__%[2]sCmd | Resolve-Path) } } # Register args completer for all cmds and aliases -Register-ArgumentCompleter -CommandName ([array]$available%[2]s.Name + [array]${__%[2]sAliases}.Name + @('%[1]s')) -ScriptBlock ${__%[2]sCompleterBlock} +[string[]]$joint%[2]snames = [array]$available%[2]s.Name + [array]${__%[2]sAliases}.Name + @('%[1]s') +Register-ArgumentCompleter -CommandName $joint%[2]snames -ScriptBlock ${__%[2]sCompleterBlock} `, name, nameForVar, compCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))