summaryrefslogtreecommitdiff
path: root/cmd/podman/completion/completion.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-29 15:17:44 +0000
committerGitHub <noreply@github.com>2021-03-29 15:17:44 +0000
commit08eab3f8f77d8206e3c788fa0a8f455ef854db1c (patch)
treeda30d4e61cd38be2b04179ffd940834b90ea767c /cmd/podman/completion/completion.go
parent00792f8c95f804c446f8ae8e0e105a240074198e (diff)
parent6a78fcaa0a5451e8b9839c689b01c9264e391401 (diff)
downloadpodman-08eab3f8f77d8206e3c788fa0a8f455ef854db1c.tar.gz
podman-08eab3f8f77d8206e3c788fa0a8f455ef854db1c.tar.bz2
podman-08eab3f8f77d8206e3c788fa0a8f455ef854db1c.zip
Merge pull request #9307 from Luap99/powershell-completion
Add powershell completions
Diffstat (limited to 'cmd/podman/completion/completion.go')
-rw-r--r--cmd/podman/completion/completion.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/podman/completion/completion.go b/cmd/podman/completion/completion.go
index a4ceab4b0..472068130 100644
--- a/cmd/podman/completion/completion.go
+++ b/cmd/podman/completion/completion.go
@@ -21,7 +21,7 @@ const (
var (
file string
noDesc bool
- shells = []string{"bash", "zsh", "fish"}
+ shells = []string{"bash", "zsh", "fish", "powershell"}
completionCmd = &cobra.Command{
Use: fmt.Sprintf("completion [options] {%s}", strings.Join(shells, "|")),
Short: "Generate shell autocompletions",
@@ -76,6 +76,12 @@ func completion(cmd *cobra.Command, args []string) error {
}
case "fish":
err = cmd.Root().GenFishCompletion(w, !noDesc)
+ case "powershell":
+ if noDesc {
+ err = cmd.Root().GenPowerShellCompletion(w)
+ } else {
+ err = cmd.Root().GenPowerShellCompletionWithDesc(w)
+ }
}
if err != nil {