github.com/pborman/options (go): Package options provides a structured interface for getopt style flag parsing.  It is particularly helpful for parsing an option set more than once and possibly concurrently.  This package was designed to make option specification simpler and more concise.  It is a wrapper around the github.com/pborman/getopt/v2 package.  Package options also provides a facility to specify command line options in a text file by using the Flags type (described below).  Options are declared in a structure that contains all information needed for the options.  Each exported field of the structure represents an option.  The fields tag is used to provide additional details.  The tag contains up to four pieces of information:  The syntax of a tag is:  The long and/or short options must come first in the tag.  The parameter name is specified by appending =PARAM to one of the declared options (e.g., --option=VALUE).  The description is everything following the option declaration(s).  The options and description message are delimited by one or more white space characters.  An empty option (- or --) terminates option declarations, everything following is the description.  This enables the description to start with a -, e.g. "-v -- -v means verbose".  The following are example tags  A tag of just "-" causes the field to be ignored an not used as an option. An empty tag or missing tag causes the tag to be auto-generated.  The fields of the structure can be any type that can be passed to getopt.Flag as a pointer (e.g., string, []string, int, bool, time.Duration, etc).  This includes any type that implements getopt.Value.  The following structure declares 7 options and sets the default value of Count to be 42.  The --flags option is used to read option values from a file.  The help message generated from theOptions is:  The following are various ways to use the above declaration.
Keywords: getopt|go