cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2014 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cli provides common utilities for commandline handling in conjunction with codegansta/cli

Index

Constants

View Source
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 AddAdditinalFlags(a *cli.App)

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

func CheckCommonFlagsAndInit(cmd api.Runner, c *cli.Context) error

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 CliFinishApp(c *cli.Context) error

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

func RunAction

func RunAction(cmd api.Runner, c *cli.Context)

Runs a standard runner from within the cli, dealing with errors accoringly Both handlers may be nil to use a default one

Types

This section is empty.

Directories

Path Synopsis
Package app provides a codegansta/cli.App initialized with all known godi commands.
Package app provides a codegansta/cli.App initialized with all known godi commands.

Jump to

Keyboard shortcuts

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