go-getoptions v0.15.0 Release Notes
Release Date: 2019-08-30 // over 4 years ago-
🚀 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 newSetCommandFn
method.🆕 New Features
• Introduce
getoptions.NewCommand()
to declare commands and clearly separate their role from the maingetoptions.New()
.• Introduce
command.SetCommandFn(fn CommandFn)
to declare a commands function callback.• Introduce
opt.Dispatch(helpOptionName string, args []string)
to automatically handle dispatching to theCommandFn
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 byWARNING:
.📚 • Minor README updates... New features need proper documentation.
• Minor automated help changes.