Documentation ¶
Index ¶
- Constants
- func BindFlagsLoadViper(cmd *cobra.Command, args []string) error
- func InitEnv(prefix string)
- func NewCompletionCmd(rootCmd *cobra.Command, hidden bool) *cobra.Command
- func PrepareBaseCmd(cmd *cobra.Command, envPrefix, defaultHome string) *cobra.Command
- func RunWithArgs(ctx context.Context, cmd *cobra.Command, args []string, env map[string]string) error
- func RunWithTrace(ctx context.Context, cmd *cobra.Command) error
- func WriteConfigVals(dir string, vals map[string]string) error
- type Executable
- type Executor
- type ExitCoder
Constants ¶
View Source
const ( HomeFlag = "home" TraceFlag = "trace" OutputFlag = "output" // used in the cli )
Variables ¶
This section is empty.
Functions ¶
func BindFlagsLoadViper ¶
Bind all flags and read the config into viper
func NewCompletionCmd ¶
NewCompletionCmd returns a cobra.Command that generates bash and zsh completion scripts for the given root command. If hidden is true, the command will not show up in the root command's list of available commands.
func PrepareBaseCmd ¶
PrepareBaseCmd is meant for tendermint and other servers
func RunWithArgs ¶
func RunWithArgs(ctx context.Context, cmd *cobra.Command, args []string, env map[string]string) error
RunWithArgs executes the given command with the specified command line args and environmental variables set. It returns any error returned from cmd.Execute()
This is only used in testing.
Types ¶
type Executable ¶
type Executable interface {
Execute() error
}
Click to show internal directories.
Click to hide internal directories.