Skip to content

Add support for optional values

Choose a tag to compare

@pborman pborman released this 15 Jun 03:27
· 1 commit to master since this release

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.