Skip to content

Releases

A Counter support

Choose a tag to compare

@pborman pborman released this 23 Aug 02:15

Full Changelog: v1.5.0...v1.6.0

Add support for optional values

Choose a tag to compare

@pborman pborman released this 15 Jun 03:27

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

Choose a tag to compare

@pborman pborman released this 22 Dec 02:14

The flags sub package has been moved to gitHub.com/pborman/flags.

Make the flags sub package more generic

Choose a tag to compare

@pborman pborman released this 16 Dec 02:35
v1.4.1

Make it possible to use other flag packages.

Add support for the standard flag package

Choose a tag to compare

@pborman pborman released this 13 Dec 18:43

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

Choose a tag to compare

@pborman pborman released this 12 Mar 03:49

It appears options_test.go was corrupted causing the build to fail.

Minor usability improvemnts

Choose a tag to compare

@pborman pborman released this 09 Sep 21:58

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

Choose a tag to compare

@pborman pborman released this 15 Jan 02:25

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

Choose a tag to compare

@pborman pborman released this 26 May 15:22

This is a minor update improving documentation and adding an additional test on using custom types that implment getopt.Value.

Easy Go Option Parsing

Choose a tag to compare

@pborman pborman released this 09 Apr 19:08

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.