Documentation
¶
Index ¶
Constants ¶
View Source
const HelpTemplate = `` /* 1108-byte string literal not displayed */
Template for CLI help output
Variables ¶
View Source
var ErrMustRunAsRoot = fmt.Errorf("must run as root")
ErrMustRunAsRoot is returned when a command must be run as root.
Functions ¶
func IsRunningAsRoot ¶
IsRunningAsRoot returns true if the current user has UID 0.
func NewLogger ¶
func NewLogger(opts *GlobalOptions) *zap.Logger
Types ¶
type Command ¶
type Command interface {
Run(log *zap.Logger, opts *GlobalOptions) error
Flaggy() *flaggy.Subcommand
}
type CommandContainer ¶
type CommandContainer interface {
AddCommand(Command)
Flaggy() *flaggy.Subcommand
Run(log *zap.Logger, opts *GlobalOptions) error
AsCommand() Command
}
func NewCommandContainer ¶
func NewCommandContainer(name, description string) CommandContainer
type GlobalOptions ¶
type GlobalOptions struct {
DevelopmentMode bool
}
func NewGlobalOptions ¶
func NewGlobalOptions() *GlobalOptions
Click to show internal directories.
Click to hide internal directories.