Documentation
¶
Overview ¶
Package flarg parses command line arguments using the fields from a struct. derived from: https://github.com/alexflint/go-arg
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NoPointer = Xrror("%s is not a pointer (did you forget an ampersand?)").Out NoStructPointer = Xrror("%T is not a struct pointer").Out UnsupportedField = Xrror("%s.%s: %s fields are not supported").Out LongShortArguments = Xrror("%s.%s: short arguments must be one character only").Out UnrecognizedTag = Xrror("unrecognized tag '%s' on field %s").Out )
View Source
var ( ProcessError = Xrror("error processing %s: %v").Out UnknownArgument = Xrror("unknown argument %s").Out MissingValue = Xrror("missing value for %s").Out Required = Xrror("%s is required").Out PositionalError = Xrror("too many positional arguments at '%s'").Out )
View Source
var ( NotExported = Xrror("%v field is not exported").Out NotScalar = Xrror("not a scalar type: %s").Out )
View Source
var InvalidArg = Xrror("%s is not a valid argument").Out
View Source
var Unwritable = Xrror("%v field is not writable").Out
Functions ¶
func MustParse ¶
func MustParse(dest interface{}, exclude ...string)
MustParse processes command line arguments and exits upon failure
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser represents a set of command line options with destination values
func (*Parser) Help ¶
Help writes the usage string of the provided []*spec followed by the full help string for each option
Click to show internal directories.
Click to hide internal directories.