From 8dd26289bf516dcfbd9aaad6d2dd65c9f84380c8 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 22 Jun 2020 14:29:04 -0700 Subject: Fixes --remote flag issues * --remote, --url and --identity are now anchored to podman command. Subcommands should no longer have issues * TraverseChildren now set to V1 expectations * Latest flag now has helper function. Now has consistent usage. * IsRemote() uses cobra parser to determin if --remote is given * Moved validation functions from parser pkg to validate pkg * Fixes #6598 Fixes #6704 Signed-off-by: Jhon Honce Signed-off-by: Matt Heon --- cmd/podman/validate/latest.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 cmd/podman/validate/latest.go (limited to 'cmd/podman/validate/latest.go') diff --git a/cmd/podman/validate/latest.go b/cmd/podman/validate/latest.go new file mode 100644 index 000000000..6e2aa063b --- /dev/null +++ b/cmd/podman/validate/latest.go @@ -0,0 +1,15 @@ +package validate + +import ( + "github.com/containers/libpod/cmd/podman/registry" + "github.com/spf13/cobra" +) + +func AddLatestFlag(cmd *cobra.Command, b *bool) { + // Initialization flag verification + cmd.Flags().BoolVarP(b, "latest", "l", false, + "Act on the latest container podman is aware of\nNot supported with the \"--remote\" flag") + if registry.IsRemote() { + _ = cmd.Flags().MarkHidden("latest") + } +} -- cgit v1.2.3-54-g00ecf