summaryrefslogtreecommitdiff
path: root/vendor/github.com/spf13/cobra/powershell_completions.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-07-01 19:53:51 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-07-02 17:36:30 +0200
commit924cd37a37f1c58911ce7bc10b82ec9579c5c70e (patch)
tree915c05707555d02ca272036b5bbd55b7d3b41a9a /vendor/github.com/spf13/cobra/powershell_completions.go
parent04209873562dff25c5d6f800e4a535dff18d485a (diff)
downloadpodman-924cd37a37f1c58911ce7bc10b82ec9579c5c70e.tar.gz
podman-924cd37a37f1c58911ce7bc10b82ec9579c5c70e.tar.bz2
podman-924cd37a37f1c58911ce7bc10b82ec9579c5c70e.zip
Bump github.com/spf13/cobra to v1.2.1
Fixes #9730 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'vendor/github.com/spf13/cobra/powershell_completions.go')
-rw-r--r--vendor/github.com/spf13/cobra/powershell_completions.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/vendor/github.com/spf13/cobra/powershell_completions.go b/vendor/github.com/spf13/cobra/powershell_completions.go
index c55be71cd..59234c09f 100644
--- a/vendor/github.com/spf13/cobra/powershell_completions.go
+++ b/vendor/github.com/spf13/cobra/powershell_completions.go
@@ -86,7 +86,7 @@ Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock {
# We add an extra empty parameter so we can indicate this to the go method.
__%[1]s_debug "Adding extra empty parameter"
`+" # We need to use `\"`\" to pass an empty argument a \"\" or '' does not work!!!"+`
-`+" $RequestComp=\"$RequestComp\" + ' `\"`\"' "+`
+`+" $RequestComp=\"$RequestComp\" + ' `\"`\"'"+`
}
__%[1]s_debug "Calling $RequestComp"
@@ -140,19 +140,6 @@ Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock {
$Space = ""
}
- if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) {
- __%[1]s_debug "ShellCompDirectiveNoFileComp is called"
-
- if ($Values.Length -eq 0) {
- # Just print an empty string here so the
- # shell does not start to complete paths.
- # We cannot use CompletionResult here because
- # it does not accept an empty string as argument.
- ""
- return
- }
- }
-
if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or
(($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) {
__%[1]s_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported"
@@ -165,20 +152,33 @@ Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock {
# filter the result
$_.Name -like "$WordToComplete*"
- # Join the flag back if we have a equal sign flag
+ # Join the flag back if we have an equal sign flag
if ( $IsEqualFlag ) {
__%[1]s_debug "Join the equal sign flag back to the completion value"
$_.Name = $Flag + "=" + $_.Name
}
}
+ if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) {
+ __%[1]s_debug "ShellCompDirectiveNoFileComp is called"
+
+ if ($Values.Length -eq 0) {
+ # Just print an empty string here so the
+ # shell does not start to complete paths.
+ # We cannot use CompletionResult here because
+ # it does not accept an empty string as argument.
+ ""
+ return
+ }
+ }
+
# Get the current mode
$Mode = (Get-PSReadLineKeyHandler | Where-Object {$_.Key -eq "Tab" }).Function
__%[1]s_debug "Mode: $Mode"
$Values | ForEach-Object {
- # store temporay because switch will overwrite $_
+ # store temporary because switch will overwrite $_
$comp = $_
# PowerShell supports three different completion modes