flag

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoneFlagShortHand     = ""
	ErrorFlagNotSupported = "flag not supported"
)
View Source
const (
	RevisionFlagName = "revision"
	LocalFlagName    = "local"
	OfflineFlagName  = "offline"
)
View Source
const (
	UnknownProvider = "unknown"
)

Variables

This section is empty.

Functions

func AddLocalFlag

func AddLocalFlag(command *cobra.Command, local *bool) string

func AddOfflineFlag

func AddOfflineFlag(command *cobra.Command, offline *bool) string

func AddRevisionFlag

func AddRevisionFlag(command *cobra.Command, revision *string) string

func ProviderIds

func ProviderIds(providerFlags []ProviderFlag) map[ProviderFlag][]string

ProviderIds builds a subset of all the available providers, required for the enum flag

func ProviderValues

func ProviderValues(providerIds map[ProviderFlag][]string) []string

ProviderValues builds a list of labels to concatenate, required for the flag usage

Types

type ProviderFlag

type ProviderFlag enumflag.Flag
const (
	UnknownProviderFlag ProviderFlag = iota
	DockerProviderFlag
	KubeProviderFlag
	CloudProviderFlag
)

func ExistProvider

func ExistProvider(providerIds map[ProviderFlag][]string, value string) (ProviderFlag, error)

ExistProvider verify if the given string is a valid provider

func (ProviderFlag) String

func (p ProviderFlag) String() string

type SourceFlag

type SourceFlag struct {
	Revision string
	Local    bool
}

func AddTemplateSourceFlag

func AddTemplateSourceFlag(command *cobra.Command) *SourceFlag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL