modulepackage
3.1.1
Repository: https://github.com/peterebden/go-cli-init.git
Documentation: pkg.go.dev
# README
go-cli-init
Wrapper handling initialisation of flags & logging libraries
# Functions
ActiveCommand returns the name of the currently active command.
InitFileLogging initialises logging backends, both to stderr and to a file.
InitLogging initialises logging backends.
InitStructuredLogging is like InitFileLogging but allows specifying whether the output should be structured as JSON.
MustGetLogger is a wrapper around go-logging's function of the same name.
MustGetLoggerNamed is like MustGetLogger but lets the caller choose the name.
MustInitFileLogging is like InitFileLogging but dies on any errors.
MustInitStructuredLogging is like InitStructuredLogging but dies on any errors.
ParseFlags parses the app's flags and returns the parser, any extra arguments, and any error encountered.
ParseFlagsFromArgsOrDie is similar to ParseFlagsOrDie but allows control over the flags passed.
ParseFlagsOrDie parses the app's flags and dies if unsuccessful.
# Constants
MaxVerbosity is the maximum verbosity we support.
MinVerbosity is the maximum verbosity we support.
# Interfaces
A LogLevelInfo describes and can modify levels of the set of registered loggers.
# Type aliases
A ByteSize is used for flags that represent some quantity of bytes that can be passed as human-readable quantities (eg.
A CompletionHandler is the type of function that our flags library uses to handle completions.
A Duration is used for flags that represent a time duration; it's just a wrapper around time.Duration that implements the flags.Unmarshaler and encoding.TextUnmarshaler interfaces.
A Verbosity is used as a flag to define logging verbosity.