Skip to content

Commit

Permalink
powershell: escape variable with curly brackets
Browse files Browse the repository at this point in the history
This fixes an issue with program names that include a dot, in our case
`podman.exe`. This was caused by the change in commit 6ba7ebb.

Fixes #1853

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
  • Loading branch information
Luap99 committed May 16, 2023
1 parent 284f410 commit cb5dbfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions powershell_completions.go
Expand Up @@ -47,7 +47,7 @@ filter __%[1]s_escapeStringWithSpecialChars {
`+" $_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|\"|`|\\||<|>|&','`$&'"+`
}
[scriptblock]$__%[2]sCompleterBlock = {
[scriptblock]${__%[2]sCompleterBlock} = {
param(
$WordToComplete,
$CommandAst,
Expand Down Expand Up @@ -279,7 +279,7 @@ filter __%[1]s_escapeStringWithSpecialChars {
}
}
Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock $__%[2]sCompleterBlock
Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock ${__%[2]sCompleterBlock}
`, name, nameForVar, compCmd,
ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp,
ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))
Expand Down

0 comments on commit cb5dbfe

Please sign in to comment.