Repository navigation
Releases
A Counter support
Full Changelog: v1.5.0...v1.6.0
Add support for optional values
This release adds the ability to specify a value is optional for a parameter (getopt.SetOptional).
For example:
Opt string `getopt:"--opt?=STR optional STR"`
On the command line the user can either say --opt or --opt=value.
Use options.IsSet("opt") to see if it was actually set or not.
flags sub package moved
The flags sub package has been moved to gitHub.com/pborman/flags.
Make the flags sub package more generic
v1.4.1 Make it possible to use other flag packages.
Add support for the standard flag package
This release includes the flags subpackage which is similar to the options package but works with the standard flag package.
The flags subpackage is subject to change at this point.
Minor fix to test code
It appears options_test.go was corrupted causing the build to fail.
Minor usability improvemnts
Make the options package more standalone by adding wrappers for
getopt.PrintUsage
getopt.Usage
getopt.SetParameters
getopt.SetProgram
getopt.SetUsage
And enable setting of getopt global variables with:
SetDisplayWidth
SetHelpColumn
Add SubRegisterAndParse
SubRegisterAndParse is similar to RegisterAndParse but the caller provides the arguments and it returns an error rather than exiting the program on error. This is useful when parsing sub commands.
Documentation Update
This is a minor update improving documentation and adding an additional test on using custom types that implment getopt.Value.
Easy Go Option Parsing
This release adds a new type, options.Help to support displaying help. Normal usage is:
var opts = struct {
Help options.Help `getopt:"--help display help"`
...
}
With this, if --help is provided on the command line the command's usage information will be display on standard output and the command will exit with a status of 0.