verflag

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package verflag defines utility functions to handle command line flags related to version of Kubernetes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(fs *flag.FlagSet)

AddFlags registers this package's flags on arbitrary FlagSets, such that they point to the same value as the global flags.

func PrintAndExitIfRequested

func PrintAndExitIfRequested()

PrintAndExitIfRequested will check if the -version flag was passed and, if so, print the version and exit.

func VersionVar

func VersionVar(p *VersionValue, name string, value VersionValue, usage string)

Types

type VersionValue added in v0.1.9

type VersionValue int
const (
	VersionFalse VersionValue = 0
	VersionTrue  VersionValue = 1
	VersionRaw   VersionValue = 2
)

func Version

func Version(name string, value VersionValue, usage string) *VersionValue

func (*VersionValue) Get added in v0.1.9

func (v *VersionValue) Get() interface{}

func (*VersionValue) IsBoolFlag added in v0.1.9

func (v *VersionValue) IsBoolFlag() bool

func (*VersionValue) Set added in v0.1.9

func (v *VersionValue) Set(s string) error

func (*VersionValue) String added in v0.1.9

func (v *VersionValue) String() string

func (*VersionValue) Type added in v0.1.9

func (v *VersionValue) Type() string

Type The type of the flag as required by the pflag.Value interface.

Jump to

Keyboard shortcuts

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