Documentation ¶
Overview ¶
Package cli provides common utilities for commandline handling in conjunction with codegansta/cli
Index ¶
- Constants
- func AddAdditinalFlags(a *cli.App)
- func CheckCommonFlags(c *cli.Context) (nr int, level api.Importance, filters []api.FileFilter, err error)
- func CheckCommonFlagsAndInit(cmd api.Runner, c *cli.Context) error
- func CliFinishApp(c *cli.Context) error
- func MakeLogHandler(maxLogLevel api.Importance) func(r api.Result) bool
- func MakeStatisticalLogHandler(stats *api.Stats, handler func(api.Result) bool, done <-chan bool) func(api.Result) bool
- func RunAction(cmd api.Runner, c *cli.Context)
Constants ¶
const ( StatisticalLoggingInterval = 1 * time.Second TimeEpsilon = 40 * time.Millisecond StreamsPerInputDeviceFlagName = "streams-per-input-device" LogLevelFlagName = "verbosity" FileExcludePatternFlagName = "file-exclude-patterns" )
Variables ¶
This section is empty.
Functions ¶
func AddAdditinalFlags ¶ added in v1.0.0
func CheckCommonFlags ¶ added in v1.0.0
func CheckCommonFlags(c *cli.Context) (nr int, level api.Importance, filters []api.FileFilter, err error)
As CheckCommonFlagsAndInit, but will return all parsed and verified common values, including an optional error
func CheckCommonFlagsAndInit ¶ added in v1.0.0
Check common args and init a command with them. Further init and checking should be done in specialized function
func CliFinishApp ¶ added in v1.0.0
func MakeLogHandler ¶ added in v1.0.0
func MakeLogHandler(maxLogLevel api.Importance) func(r api.Result) bool
func MakeStatisticalLogHandler ¶ added in v1.0.0
func MakeStatisticalLogHandler(stats *api.Stats, handler func(api.Result) bool, done <-chan bool) func(api.Result) bool
Wraps an Aggregator handler and tracks last time the handler was called. If it was more than a certain amount of seconds ago, we will release a message about what's currently going on based on the statistical information we are passed NOTE: Even though it would be cleaner to just inject messages into the results channel, this way we wouldn't know when the last message was emitted, possibly emitting too much Done should be called to signal that we should stop
Types ¶
This section is empty.