cmd

package
v0.0.49 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigErrorCheck added in v0.0.30

func ConfigErrorCheck(rootCmd *cobra.Command, err error)

ConfigErrorCheck will print error only if no args passed Main reason to do it in PreRun allows us to run root cmd as usual,

parse help flags if any provided or check if its help command.

For example if config load failed with error (no lets.yaml in current dir) - print error and exit.

func CreateRootCommand

func CreateRootCommand(version string) *cobra.Command

CreateRootCommand used to run only root command without config.

func CreateRootCommandWithConfig added in v0.0.30

func CreateRootCommandWithConfig(out io.Writer, cfg *config.Config, version string) *cobra.Command

CreateRootCommandWithConfig used to run root command with all subcommands.

Types

This section is empty.

Jump to

Keyboard shortcuts

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