diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-02-22 22:10:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-22 22:10:07 +0100 |
commit | 84b3f2a7f622636e622416403d1f2642edbbd117 (patch) | |
tree | 56abfe745ffb65c6fbb75824807345c217d684f8 /cmd/podman/stop.go | |
parent | c757cb23ca15634077a8b9fa33aba7abd1c8249b (diff) | |
parent | 6ab6e2c3073d47755d441ee8c1bce90e34082e99 (diff) | |
download | podman-84b3f2a7f622636e622416403d1f2642edbbd117.tar.gz podman-84b3f2a7f622636e622416403d1f2642edbbd117.tar.bz2 podman-84b3f2a7f622636e622416403d1f2642edbbd117.zip |
Merge pull request #2386 from baude/cobravalidation
Improve command line validation
Diffstat (limited to 'cmd/podman/stop.go')
-rw-r--r-- | cmd/podman/stop.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/podman/stop.go b/cmd/podman/stop.go index 94fdf321e..67c15b2a8 100644 --- a/cmd/podman/stop.go +++ b/cmd/podman/stop.go @@ -32,6 +32,9 @@ var ( stopCommand.GlobalFlags = MainGlobalOpts return stopCmd(&stopCommand) }, + Args: func(cmd *cobra.Command, args []string) error { + return checkAllAndLatest(cmd, args, false) + }, Example: `podman stop ctrID podman stop --latest podman stop --timeout 2 mywebserver 6e534f14da9d`, @@ -46,6 +49,7 @@ func init() { flags.BoolVarP(&stopCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of") flags.UintVar(&stopCommand.Timeout, "time", libpod.CtrRemoveTimeout, "Seconds to wait for stop before killing the container") flags.UintVarP(&stopCommand.Timeout, "timeout", "t", libpod.CtrRemoveTimeout, "Seconds to wait for stop before killing the container") + markFlagHiddenForRemoteClient("latest", flags) } func stopCmd(c *cliconfig.StopValues) error { @@ -54,10 +58,6 @@ func stopCmd(c *cliconfig.StopValues) error { defer span.Finish() } - if err := checkAllAndLatest(&c.PodmanCommand); err != nil { - return err - } - rootless.SetSkipStorageSetup(true) runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand) if err != nil { |