flag

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WithArgumentsFlag = NewStringVar("with-arguments", "",
		config.TranslateInLang(_flagWithArgumentsUsage, config.UILanguage))
)

vars

Functions

This section is empty.

Types

type Flag

type Flag interface {
	Label() string
	RegisterCommand(*cobra.Command)
	Value() interface{}
	MarkFlagRequired(*cobra.Command)
}

Flag defines a cobra command flag

func BoolVarP added in v0.8.1

func BoolVarP(
	label string,
	shortLabel string,
	defaultValue bool,
	description string,
) Flag

BoolVarP creates a new stringVarP flag

func NewStringVar added in v1.0.0

func NewStringVar(
	label string,
	defaultValue string,
	description string,
) Flag

NewStringVar creates a new stringVar flag

func NewStringVarP

func NewStringVarP(
	label string,
	shortLabel string,
	defaultValue string,
	description string,
) Flag

NewStringVarP creates a new stringVarP flag

func NewUint64VarP

func NewUint64VarP(
	label string,
	shortLabel string,
	defaultValue uint64,
	description string,
) Flag

NewUint64VarP creates a new uint64VarP flag

Jump to

Keyboard shortcuts

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