All Versions
18
Latest Version
Avg Release Cycle
80 days
Latest Release
1310 days ago

Changelog History
Page 2

  • v0.15.0 Changes

    August 30, 2019

    ๐Ÿš€ As the releases before, this release has 100% test coverage.

    ๐Ÿ”„ Change workflow to deal with ambiguities between parent and child.

    For example, the root may have option --profile and the command the option --password with alias -p. If -p is passed, the parent would uncorrectly be matched.

    For the parent to properly handle ambiguities with its children, it needs to have knowledge of them. A new getoptions.NewCommand has been introduced.

    To help with the verbosity of handling all the commands, a new Dispatch method is introduced, it will call a command's function defined with the new SetCommandFn method.

    ๐Ÿ†• New Features

    โ€ข Introduce getoptions.NewCommand() to declare commands and clearly separate their role from the main getoptions.New().

    โ€ข Introduce command.SetCommandFn(fn CommandFn) to declare a commands function callback.

    โ€ข Introduce opt.Dispatch(helpOptionName string, args []string) to automatically handle dispatching to the CommandFn based on the cli input.

    โ€ข Make options unambiguous with commands.
    For example, the root may have option --profile and the command the option --password with alias -p. If -p is passed, the parent would uncorrectly be matched.

    โ€ข Introduce new error indicating which options are getting matched with ambiguous options.

    โ€ข Add getoptions.HelpCommand() to have an automated help command.
    It adds completions for all other commands automatically.

    Minor changes

    โš  โ€ข Fix unknown option warning formatting.
    โš  Each warning has its own line and it is preceded by WARNING:.

    ๐Ÿ“š โ€ข Minor README updates... New features need proper documentation.

    โ€ข Minor automated help changes.

  • v0.14.1 Changes

    July 28, 2019

    Bypass double dot golang modules error:
    golang/go#27299

  • v0.14.0 Changes

    July 28, 2019

    ๐Ÿš€ As the releases before, this release has 100% test coverage.

    ๐Ÿš€ This release introduces bash completion by default and works out many kinks around subcommands.
    An example showing subcommands can be found in ./examples/mygit.

    ๐Ÿ’ฅ Breaking changes

    ๐Ÿšš โ€ข Remove support for Go < v1.10 (v1.5 - v1.9).

    โ€ข Rename getoptions.Option to getoptions.Value.
    โš  WARNING: A new getoptions.Option method is has been introduced, but the new one returns *option.Option instead.

    โ€ข Change the argument of opt.SetMode and opt.SetUnknownMode from a string to a getoptions.Mode and getoptions.UnknownMode type.
    ๐Ÿ‘‰ Makes it easier to autodiscover valid arguments for the method.

    ๐Ÿ”จ โ€ข Refactor section help methods into the main opt.Help one.

    - opt.HelpName()+ opt.Help(getoptions.HelpName)- opt.HelpSynopsis()+ opt.Help(getoptions.HelpSynopsis)- opt.HelpCommandList()+ opt.Help(getoptions.HelpCommandList)- opt.HelpOptionList()+ opt.Help(getoptions.HelpOptionList)
    

    ๐Ÿ–จ To print all the sections of the automated help, continue to use opt.Help().

    ๐Ÿ†• New Features

    0๏ธโƒฃ โ€ข Implement bash completion by default.

    โž• Add the following to your .bashrc:
    0๏ธโƒฃ complete -o default -C "/binary/location/myscript" myscript

    โ€ข New getoptions.Option method that returns *option.Option.
    In combination with the new getoptions.SetOption it allows to pass options from parent to subcommand.

    โ€ข Add getoptions.CustomCompletion method.
    Given a list, it will add the elements of the list to the completion alternatives.

    โ€ข Add getoptions.StringMapVar method.

    Minor changes

    โ€ข Pad SYNOPSIS content with 4 spaces.
    โ€ข Add Self method to populate help NAME section.

    Backend changes

    ๐Ÿ”จ โ€ข Refactor the code into more modular pieces.

  • v0.13.0 Changes

    March 02, 2019

    ๐Ÿš€ As the releases before, this release has 100% test coverage.

    ๐Ÿ†• New Features

    • Experimental implementation of help messages.
    • ๐Ÿ‘‰ Show used alias in errors for single options (not slice or maps).
    • โž• Add opt.CalledAs method to know how the option was called.

    Minor changes

    • โž• Add example script.
    • โž• Add golang 1.12 to test suite.
  • v0.12.0 Changes

    February 19, 2019

    ๐Ÿš€ As the releases before, this release has 100% test coverage.

    ๐Ÿ’ฅ Breaking change: Update function signatures

    ๐Ÿ”„ Change all function signatures from:

    XVar(p *bool, name string, def bool, aliases ...string)

    To:

    XVar(p *bool, name string, def bool, fns ...ModifyFn)

    This change allows to pass different functions to the option that will
    modify single option behaviour and will allow for multiple features
    without future breaking changes in the function signature.

    ๐Ÿ‘ As part as this change, a new function, opt.Alias is added to support
    previous functionality.

    โšก๏ธ To update, change the aliases from a list of aliases as the variadic
    last argument to a list of aliases passed to the opt.Alias function.
    For example:

    - opt.BoolVar(&flag, "flag", false, "f", "alias2")+ opt.BoolVar(&flag, "flag", false, opt.Alias("f", "alias2"))
    

    ๐Ÿ†• New Features

    • โž• Add opt.Alias option modifier to assign option aliases.
    • โž• Add opt.Required option modifier to indicate if an option is required.
  • v0.11.0 Changes

    August 16, 2017

    ๐Ÿš€ As the releases before, this release has 100% test coverage.

    ๐Ÿ›  Fix go tip case sensitive import path:

    • davidgamba -> DavidGamba

    ๐Ÿ—„ Deprecate and rename redundant methods:

    StringSlice is redundant with StringSliceMulti.
    Calling:
    StringSlice(name, aliases...)
    Is the same as Calling:
    StringSliceMulti(name, 1, 1, aliases...)
    Consolidate API to:
    StringSlice(name, min, max, aliases...)

    StringMap is redundant with StringMapMulti.
    Calling:
    StringMap(name, aliases...)
    Is the same as Calling:
    StringMapMulti(name, 1, 1, aliases...)
    Consolidate API to:
    StringMap(name, min, max, aliases...)

    ๐Ÿ“‡ Rename IntSliceMulti to IntSlice.

    ๐Ÿ†• New features:

    โž• Add StringSliceVar and IntSliceVar methods.

    โž• Add option to SetMapKeysToLower.

  • v0.10.0

    March 22, 2017
  • v0.9.0

    February 04, 2017