aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2020-09-14 20:07:20 +0200
committerPaul Holzinger <paul.holzinger@web.de>2020-09-15 00:02:45 +0200
commit685ef847dd9dc117cafa2ed2217d4d66d0fc4b6d (patch)
tree4fa4c75ac5fda857081bda64b1b308b15f69c104 /cmd
parentfd7cdb25027bb33c33eacb99f1a02838eca5d684 (diff)
downloadpodman-685ef847dd9dc117cafa2ed2217d4d66d0fc4b6d.tar.gz
podman-685ef847dd9dc117cafa2ed2217d4d66d0fc4b6d.tar.bz2
podman-685ef847dd9dc117cafa2ed2217d4d66d0fc4b6d.zip
podman wait accept args > 1
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/containers/wait.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/podman/containers/wait.go b/cmd/podman/containers/wait.go
index 74ee6073a..9bb39e978 100644
--- a/cmd/podman/containers/wait.go
+++ b/cmd/podman/containers/wait.go
@@ -23,7 +23,6 @@ var (
Short: "Block on one or more containers",
Long: waitDescription,
RunE: wait,
- Args: validate.IDOrLatestArgs,
Example: `podman wait --interval 5000 ctrID
podman wait ctrID1 ctrID2`,
}
@@ -33,7 +32,6 @@ var (
Short: waitCommand.Short,
Long: waitCommand.Long,
RunE: waitCommand.RunE,
- Args: validate.IDOrLatestArgs,
Example: `podman container wait --interval 5000 ctrID
podman container wait ctrID1 ctrID2`,
}
@@ -76,6 +74,13 @@ func wait(cmd *cobra.Command, args []string) error {
return errors.New("interval must be greater then 0")
}
+ if !waitOptions.Latest && len(args) == 0 {
+ return errors.Errorf("%q requires a name, id, or the \"--latest\" flag", cmd.CommandPath())
+ }
+ if waitOptions.Latest && len(args) > 0 {
+ return errors.New("--latest and containers are not allowed")
+ }
+
waitOptions.Condition, err = define.StringToContainerStatus(waitCondition)
if err != nil {
return err