Documentation ¶
Overview ¶
Package option provides utilities of option handling
Index ¶
- Variables
- func RegisterBoolFlag(cmd *cobra.Command, flagConfig *BoolFlag) error
- func RegisterIntFlag(cmd *cobra.Command, flagConfig *IntFlag) error
- func RegisterStringFlag(cmd *cobra.Command, flagConfig *StringFlag) error
- type BoolFlag
- type Flag
- type IntFlag
- type RootCmdConfig
- type RootCmdRawConfig
- type RunCmdConfig
- type RunCmdRawConfig
- type StringFlag
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultStringValue = "__DEFAULT_STRING_VALUE__"
Functions ¶
func RegisterBoolFlag ¶
RegisterBoolFlag register bool flag to provided cmd and viper
func RegisterIntFlag ¶
RegisterIntFlag register bool flag to provided cmd and viper
func RegisterStringFlag ¶
func RegisterStringFlag(cmd *cobra.Command, flagConfig *StringFlag) error
RegisterStringFlag register string flag to provided cmd and viper
Types ¶
type Flag ¶
type Flag struct { IsPersistent bool IsRequired bool Shorthand string Name string Usage string ViperName string }
Flag represents flag which can be specified
type RootCmdConfig ¶
type RootCmdConfig struct{}
func NewRootCmdConfigFromViper ¶
func NewRootCmdConfigFromViper() (*RootCmdConfig, error)
type RootCmdRawConfig ¶
type RunCmdConfig ¶
func NewRunCmdConfigFromViper ¶
func NewRunCmdConfigFromViper() (*RunCmdConfig, error)
type RunCmdRawConfig ¶
type RunCmdRawConfig struct { File string Root string Num int State string // TODO: viper cannot parse map[string]string correctly. See https://github.com/spf13/viper/issues/608 }
Click to show internal directories.
Click to hide internal directories.