Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProgramInfo struct { Name string Description string }
Functions ¶
func Argv ¶
Argv fetches command line argument by its name. Usable only after ParseArgv is completed.
func Blame ¶
func Blame(format string, args ...interface{})
Blame prints message to stderr using fmt.Fprintf and then exits with non-zero status code.
func ParseArgv ¶
func ParseArgv(schema ArgvSchema)
ParseArgv parses command line arguments using specified schema. Argument values can be accessed via Argv function.
Types ¶
type ArgTemplate ¶
type ArgTemplate struct { // If set to true, error if raised when argument is not // set explicitly. Req bool // If set to true, Help string is parsed for {[\w\|]*} pattern. // Value is checked against that pattern. Enum bool // Default value. Init string // Argument description. Help string }
ArgTemplate describes command line argument.
type ArgvSchema ¶
type ArgvSchema map[string]ArgTemplate
ArgvSchema is a set of command line arguments accepted by application.
Click to show internal directories.
Click to hide internal directories.