summaryrefslogtreecommitdiff
path: root/cmd/podman/pods/start.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/pods/start.go')
-rw-r--r--cmd/podman/pods/start.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/podman/pods/start.go b/cmd/podman/pods/start.go
index 28ee4769a..7cd5c64d9 100644
--- a/cmd/podman/pods/start.go
+++ b/cmd/podman/pods/start.go
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
+ "github.com/containers/common/pkg/completion"
"github.com/containers/podman/v2/cmd/podman/common"
"github.com/containers/podman/v2/cmd/podman/registry"
"github.com/containers/podman/v2/cmd/podman/utils"
@@ -31,6 +32,7 @@ var (
Args: func(cmd *cobra.Command, args []string) error {
return validate.CheckAllLatestAndPodIDFile(cmd, args, false, true)
},
+ ValidArgsFunction: common.AutocompletePods,
Example: `podman pod start podID
podman pod start --latest
podman pod start --all`,
@@ -50,7 +52,11 @@ func init() {
flags := startCommand.Flags()
flags.BoolVarP(&startOptions.All, "all", "a", false, "Restart all running pods")
- flags.StringArrayVarP(&startOptions.PodIDFiles, "pod-id-file", "", nil, "Read the pod ID from the file")
+
+ podIDFileFlagName := "pod-id-file"
+ flags.StringArrayVarP(&startOptions.PodIDFiles, podIDFileFlagName, "", nil, "Read the pod ID from the file")
+ _ = startCommand.RegisterFlagCompletionFunc(podIDFileFlagName, completion.AutocompleteDefault)
+
validate.AddLatestFlag(startCommand, &startOptions.Latest)
}