aboutsummaryrefslogtreecommitdiff
path: root/completions/powershell
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-21 17:37:14 +0000
committerGitHub <noreply@github.com>2022-06-21 17:37:14 +0000
commitb8b0fa80454fe0f3bcdab24bbf17cf0b6c2e8661 (patch)
treeb20a2993e7c5cc5015476c65e15edb8b4bccf207 /completions/powershell
parent588d8ec371202b5f6101c11f4c3e2952c2843d85 (diff)
parent050693b2e773e6334dc200fc0c819e3829ac400d (diff)
downloadpodman-b8b0fa80454fe0f3bcdab24bbf17cf0b6c2e8661.tar.gz
podman-b8b0fa80454fe0f3bcdab24bbf17cf0b6c2e8661.tar.bz2
podman-b8b0fa80454fe0f3bcdab24bbf17cf0b6c2e8661.zip
Merge pull request #14683 from Luap99/bump-cobra
bump github.com/spf13/cobra from 1.4.0 to 1.5.0
Diffstat (limited to 'completions/powershell')
-rw-r--r--completions/powershell/podman-remote.ps15
-rw-r--r--completions/powershell/podman.ps15
2 files changed, 8 insertions, 2 deletions
diff --git a/completions/powershell/podman-remote.ps1 b/completions/powershell/podman-remote.ps1
index 2edc79ffb..d810ab8dd 100644
--- a/completions/powershell/podman-remote.ps1
+++ b/completions/powershell/podman-remote.ps1
@@ -44,6 +44,7 @@ Register-ArgumentCompleter -CommandName 'podman-remote' -ScriptBlock {
# Prepare the command to request completions for the program.
# Split the command at the first space to separate the program and arguments.
$Program,$Arguments = $Command.Split(" ",2)
+
$RequestComp="$Program __complete $Arguments"
__podman-remote_debug "RequestComp: $RequestComp"
@@ -73,11 +74,13 @@ Register-ArgumentCompleter -CommandName 'podman-remote' -ScriptBlock {
}
__podman-remote_debug "Calling $RequestComp"
+ # First disable ActiveHelp which is not supported for Powershell
+ $env:PODMAN_REMOTE_ACTIVE_HELP=0
+
#call the command store the output in $out and redirect stderr and stdout to null
# $Out is an array contains each line per element
Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null
-
# get directive from last line
[int]$Directive = $Out[-1].TrimStart(':')
if ($Directive -eq "") {
diff --git a/completions/powershell/podman.ps1 b/completions/powershell/podman.ps1
index 1cd89d0a0..4d94b6fe8 100644
--- a/completions/powershell/podman.ps1
+++ b/completions/powershell/podman.ps1
@@ -44,6 +44,7 @@ Register-ArgumentCompleter -CommandName 'podman' -ScriptBlock {
# Prepare the command to request completions for the program.
# Split the command at the first space to separate the program and arguments.
$Program,$Arguments = $Command.Split(" ",2)
+
$RequestComp="$Program __complete $Arguments"
__podman_debug "RequestComp: $RequestComp"
@@ -73,11 +74,13 @@ Register-ArgumentCompleter -CommandName 'podman' -ScriptBlock {
}
__podman_debug "Calling $RequestComp"
+ # First disable ActiveHelp which is not supported for Powershell
+ $env:PODMAN_ACTIVE_HELP=0
+
#call the command store the output in $out and redirect stderr and stdout to null
# $Out is an array contains each line per element
Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null
-
# get directive from last line
[int]$Directive = $Out[-1].TrimStart(':')
if ($Directive -eq "") {