Documentation ¶
Overview ¶
Making CLI commands have some quality without too much boilerplate.
Index ¶
- func AddLogLevelControls(flags *pflag.FlagSet)
- func Execute(app *cobra.Command)
- func Runner(run func(ctx context.Context, args []string, logger *log.Logger) error) func(*cobra.Command, []string)
- func RunnerNoArgs(run func(ctx context.Context, logger *log.Logger) error) func(*cobra.Command, []string)
- func WrapRun(run func(ctx context.Context, args []string) error) func(*cobra.Command, []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLogLevelControls ¶
adds CLI flags that control the logging level
func Execute ¶
wraps the `Execute()` call of the command to inject boilerplate details like `Use`, `Version` and handling of error to `Command.Execute()` (such as flag validation, missing command etc.)
func RunnerNoArgs ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.