verflag

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

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

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

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

func (*VersionValue) IsBoolFlag

func (v *VersionValue) IsBoolFlag() bool

func (*VersionValue) Set

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

func (*VersionValue) String

func (v *VersionValue) String() string

func (*VersionValue) Type

func (v *VersionValue) Type() string

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