cli

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagAnnotationCustom = "custom"
)

Variables

View Source
var (
	CuiQuitKeyEvtFunc  = func(g *gocui.Gui, v *gocui.View) error { return gocui.ErrQuit }
	CuiQuitUserEvtFunc = func(g *gocui.Gui) error { return gocui.ErrQuit }
	CuiNilUserEvtFunc  = func(g *gocui.Gui) error { return nil }
)

Functions

func ArgsWithDefaultErrorFunc

func ArgsWithDefaultErrorFunc(arg cobra.PositionalArgs) cobra.PositionalArgs

func ArgsWithErrorFunc

func ArgsWithErrorFunc(arg cobra.PositionalArgs,
	errFunc func(cmd *cobra.Command, err error) error) cobra.PositionalArgs

func BindPFlags

func BindPFlags(vc *viper.Viper, pFlags *pflag.FlagSet) error

func CommandPathToMarkdown

func CommandPathToMarkdown(buf *bytes.Buffer, cmd *cobra.Command)

func DefaultArgErrorFunc

func DefaultArgErrorFunc(cmd *cobra.Command, err error) error

func DefaultFlagErrorFunc

func DefaultFlagErrorFunc(cmd *cobra.Command, err error) error

func FlagToMarkdown

func FlagToMarkdown(buf *bytes.Buffer, vcs ...*viper.Viper) func(f *pflag.Flag)

func GenerateMarkdown

func GenerateMarkdown(cmd *cobra.Command, parentVc *viper.Viper, w io.Writer)

func GetEnvKeyReplacer

func GetEnvKeyReplacer(vc *viper.Viper) *strings.Replacer

func GetStringMap

func GetStringMap(f *pflag.Flag) (map[string]interface{}, error)

func HttpResponsePrettyPrintln

func HttpResponsePrettyPrintln(w io.Writer, resp *http.Response) error

func IsDirectory

func IsDirectory(p string) (bool, error)

func JsonPrettyCopyAndClose

func JsonPrettyCopyAndClose(w io.Writer, r io.ReadCloser) error

func JsonPrettyPrintln

func JsonPrettyPrintln(w io.Writer, v interface{}) error

func JsonPrettySaveFile

func JsonPrettySaveFile(filename string, perm os.FileMode, v interface{}) error

func MarkAnnotationCustom

func MarkAnnotationCustom(fs *pflag.FlagSet, names ...string) error

func MarkAnnotationHidden

func MarkAnnotationHidden(fs *pflag.FlagSet, names ...string) error

func MarkAnnotationRequired

func MarkAnnotationRequired(fs *pflag.FlagSet, names ...string) error

func NewCommand

func NewCommand(parentCmd *cobra.Command, parentVc *viper.Viper, use, short string) (*cobra.Command, *viper.Viper)

func NewCui

func NewCui() (*gocui.Gui, <-chan bool)

func NewGenerateMarkdownCommand

func NewGenerateMarkdownCommand(parentCmd *cobra.Command, parentVc *viper.Viper) *cobra.Command

func NewViper

func NewViper(envPrefix string) *viper.Viper

func OnInterrupt

func OnInterrupt(cb func())

func OrArgs

func OrArgs(pArgs ...cobra.PositionalArgs) cobra.PositionalArgs

func SetEnvKeyReplacer

func SetEnvKeyReplacer(vc *viper.Viper, r *strings.Replacer)

func StartCPUProfile

func StartCPUProfile(filename string) error

func StartMemoryProfile

func StartMemoryProfile(filename string) error

func StringToStringConv

func StringToStringConv(val string) (map[string]interface{}, error)

func TermGui

func TermGui(g *gocui.Gui, termCh <-chan bool)

func ValidateFlags

func ValidateFlags(fs *pflag.FlagSet, flagNames ...string) error

func ValidateFlagsWithViper

func ValidateFlagsWithViper(vc *viper.Viper, fs *pflag.FlagSet, flagNames ...string) error

func ViperDecodeOptJson

func ViperDecodeOptJson(c *mapstructure.DecoderConfig)

func ZipDirectory

func ZipDirectory(p string, excludes ...string) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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