summaryrefslogtreecommitdiff
path: root/cmd/podmanV2/registry/registry.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-07 21:49:24 +0200
committerGitHub <noreply@github.com>2020-04-07 21:49:24 +0200
commit11c8b01e1d81008bc55fed8d6f62ce39dc5459c8 (patch)
tree36f7089418825a179b5e667a2324ba0cf39f57d0 /cmd/podmanV2/registry/registry.go
parent08fa3d511f2b96613bbbe76e517f2c9288e5bf56 (diff)
parent8ae28a55acc51a02597b23140916a690fbbdc3fc (diff)
downloadpodman-11c8b01e1d81008bc55fed8d6f62ce39dc5459c8.tar.gz
podman-11c8b01e1d81008bc55fed8d6f62ce39dc5459c8.tar.bz2
podman-11c8b01e1d81008bc55fed8d6f62ce39dc5459c8.zip
Merge pull request #5739 from jwhonce/wip/diff
V2 Podman diff(changes) support
Diffstat (limited to 'cmd/podmanV2/registry/registry.go')
-rw-r--r--cmd/podmanV2/registry/registry.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podmanV2/registry/registry.go b/cmd/podmanV2/registry/registry.go
index 401f82718..8ff44041f 100644
--- a/cmd/podmanV2/registry/registry.go
+++ b/cmd/podmanV2/registry/registry.go
@@ -113,6 +113,14 @@ func SubCommandExists(cmd *cobra.Command, args []string) error {
return errors.Errorf("missing command '%[1]s COMMAND'\nTry '%[1]s --help' for more information.", cmd.CommandPath())
}
+// IdOrLatestArgs used to validate a nameOrId was provided or the "--latest" flag
+func IdOrLatestArgs(cmd *cobra.Command, args []string) error {
+ if len(args) > 1 || (len(args) == 0 && !cmd.Flag("latest").Changed) {
+ return errors.New(`command requires a name, id or the "--latest" flag`)
+ }
+ return nil
+}
+
type podmanContextKey string
var podmanFactsKey = podmanContextKey("engineOptions")