summaryrefslogtreecommitdiff
path: root/cmd/podman/validate/latest.go
blob: 0ebed722742af682ec9c359bc68312ce0d5183a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package validate

import (
	"github.com/containers/libpod/v2/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")
	}
}