Documentation ¶
Index ¶
- Constants
- func ArgumentAsString(arguments []Argument) string
- func ArgumentsString(arguments []Argument) string
- func CommandErrorText(cmd NamedCommand) string
- func CommandHelp(c Command) string
- func Commands(metaPtr *Meta, commands CommandFunc) map[string]cli.CommandFactory
- func ExampleString(examples map[string]string) string
- func FlagString(flags *flag.FlagSet) string
- func MergeAutocompleteFlags(flags ...complete.Flags) complete.Flags
- func ParseArguments(args []string, arguments []Argument) (map[string]Argument, error)
- func SetupEnv(args []string) []string
- type Argument
- type ArgumentType
- type Command
- type CommandFunc
- type FlagSetFlags
- type GlobalFlagCommand
- type HumanWriter
- type Meta
- type NamedCommand
- type VersionCommand
- func (c *VersionCommand) Arguments() []Argument
- func (c *VersionCommand) AutocompleteArgs() complete.Predictor
- func (c *VersionCommand) AutocompleteFlags() complete.Flags
- func (c *VersionCommand) Examples() map[string]string
- func (c *VersionCommand) FlagSet() *flag.FlagSet
- func (c *VersionCommand) Help() string
- func (c *VersionCommand) Name() string
- func (c *VersionCommand) ParsedArguments(args []string) (map[string]Argument, error)
- func (c *VersionCommand) Run(args []string) int
- func (c *VersionCommand) Synopsis() string
- type ZerologUi
- func (u *ZerologUi) Ask(query string) (string, error)
- func (u *ZerologUi) AskSecret(query string) (string, error)
- func (u *ZerologUi) Error(message string)
- func (u *ZerologUi) Field(field string, value interface{}) *ZerologUi
- func (u *ZerologUi) Fields(newFields map[string]interface{}) *ZerologUi
- func (u *ZerologUi) Info(message string)
- func (u *ZerologUi) LogHeader1(message string)
- func (u *ZerologUi) LogHeader2(message string)
- func (u *ZerologUi) Output(message string)
- func (u *ZerologUi) Warn(message string)
Constants ¶
View Source
const (
EnvCliNoColor = `NO_COLOR`
)
Variables ¶
This section is empty.
Functions ¶
func ArgumentAsString ¶
func ArgumentsString ¶
func CommandErrorText ¶
func CommandErrorText(cmd NamedCommand) string
func CommandHelp ¶
func Commands ¶
func Commands(metaPtr *Meta, commands CommandFunc) map[string]cli.CommandFactory
func ExampleString ¶
func FlagString ¶
func ParseArguments ¶
Types ¶
type Argument ¶
type Argument struct { Name string Description string Optional bool Type ArgumentType Value interface{} HasValue bool }
func (Argument) StringValue ¶
type ArgumentType ¶
type ArgumentType uint
const ( ArgumentString ArgumentType = 0 ArgumentInt ArgumentType = 1 << iota ArgumentBool ArgumentType = 2 << iota ArgumentList ArgumentType = 3 << iota )
type CommandFunc ¶
type CommandFunc func(meta Meta) map[string]cli.CommandFactory
type FlagSetFlags ¶
type FlagSetFlags uint
const ( FlagSetNoe FlagSetFlags = 0 FlagSetClient FlagSetFlags = 1 << iota FlagSetDefault = FlagSetClient )
type GlobalFlagCommand ¶
type HumanWriter ¶
type HumanWriter struct { Out io.Writer NoColor bool TimeFormat string PartsOrder []string PartsExclude []string FormatTimestamp zerolog.Formatter FormatLevel zerolog.Formatter FormatCaller zerolog.Formatter FormatMessage zerolog.Formatter FormatFieldName zerolog.Formatter FormatFieldValue zerolog.Formatter FormatErrFieldName zerolog.Formatter FormatErrFieldValue zerolog.Formatter }
func NewHumanWriter ¶
func NewHumanWriter(options ...func(w *HumanWriter)) HumanWriter
type Meta ¶
func (*Meta) AutocompleteFlags ¶
func (m *Meta) AutocompleteFlags(fs FlagSetFlags) complete.Flags
func (*Meta) Colorize ¶
func (m *Meta) Colorize() *colorstring.Colorize
type NamedCommand ¶
type NamedCommand interface {
Name() string
}
type VersionCommand ¶
type VersionCommand struct {
Meta
}
func (*VersionCommand) Arguments ¶
func (c *VersionCommand) Arguments() []Argument
func (*VersionCommand) AutocompleteArgs ¶
func (c *VersionCommand) AutocompleteArgs() complete.Predictor
func (*VersionCommand) AutocompleteFlags ¶
func (c *VersionCommand) AutocompleteFlags() complete.Flags
func (*VersionCommand) Examples ¶
func (c *VersionCommand) Examples() map[string]string
func (*VersionCommand) FlagSet ¶
func (c *VersionCommand) FlagSet() *flag.FlagSet
func (*VersionCommand) Help ¶
func (c *VersionCommand) Help() string
func (*VersionCommand) Name ¶
func (c *VersionCommand) Name() string
func (*VersionCommand) ParsedArguments ¶
func (c *VersionCommand) ParsedArguments(args []string) (map[string]Argument, error)
func (*VersionCommand) Run ¶
func (c *VersionCommand) Run(args []string) int
func (*VersionCommand) Synopsis ¶
func (c *VersionCommand) Synopsis() string
type ZerologUi ¶
type ZerologUi struct { StderrLogger zerolog.Logger StdoutLogger zerolog.Logger OriginalFields map[string]interface{} Ui cli.Ui OutputIndentField bool }
func ZerologUiWithFields ¶
func (*ZerologUi) LogHeader1 ¶
func (*ZerologUi) LogHeader2 ¶
Click to show internal directories.
Click to hide internal directories.