summaryrefslogtreecommitdiff
path: root/cmd/podman/completion/completion.go
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2021-02-10 17:57:11 +0100
committerPaul Holzinger <paul.holzinger@web.de>2021-03-29 15:00:09 +0200
commit6a78fcaa0a5451e8b9839c689b01c9264e391401 (patch)
treeaaf09ea076b9a531526d7836fd0709a98a8e606b /cmd/podman/completion/completion.go
parent259004f0a9cc18018127baec0bfcf8bc091dabb6 (diff)
downloadpodman-6a78fcaa0a5451e8b9839c689b01c9264e391401.tar.gz
podman-6a78fcaa0a5451e8b9839c689b01c9264e391401.tar.bz2
podman-6a78fcaa0a5451e8b9839c689b01c9264e391401.zip
Add powershell completions
Add support for generating powershell completion files. This is especially useful for people using the podman remote client on windows. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
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 {