flags

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(cmd *cobra.Command, flag *Flag) error

Set is a "generic" function used to set flags on cobra.Command and bind them to viper.Viper.

func SetPersistent

func SetPersistent(cmd *cobra.Command, flag *Flag) error

SetPersistent is a "generic" function used to set persistent flags on cobra.Command and bind them to viper.Viper.

Types

type Flag

type Flag struct {
	Name      string
	CfgKey    string
	Shorthand string
	DefaultV  any
	Usage     string
}

Flag is the internal representation of a command flag. It is used to set flags in a more generic way.

Jump to

Keyboard shortcuts

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