Documentation ¶
Overview ¶
Package cmd provides a common utilities and helper function to standarise the way omni apps use cobra and viper to produce consistent cli experience for both users and devs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindHomeFlag ¶
BindHomeFlag binds the home flag to the given flag set. This is generally only required for apps that require multiple config files or persist data to disk. Using this flag will result in the viper config directory to be updated from default "." to "<home>/config".
func Main ¶
Main is the main entry point for the command line tool. Usage:
func main() { libcmd.Main(appcmd.New()) }
func NewRootCmd ¶
NewRootCmd returns a new root cobra command that handles our command line tool. It sets up the general viper config and binds the cobra flags to the viper flags. It also silences the usage printing when commands error during "running".
func SilenceErrUsage ¶
SilenceErrUsage silences the usage and error printing.
Types ¶
This section is empty.