added post-build option (#78)

* added post-build option

* updated PostBuild function description

Co-authored-by: Daniel Lins <daniel.lins@vidoori.com>
This commit is contained in:
Freestate17
2020-05-04 18:14:33 -04:00
committed by GitHub
parent 2d809c073b
commit c69b9a1e88
+11
View File
@@ -61,6 +61,17 @@ func NoDefaultHelp() Option {
})
}
// PostBuild provides read/write access to kong.Kong after initial construction of the model is complete but before
// parsing occurs.
//
// This is useful for, e.g., adding short options to flags, updating help, etc.
func (k *Kong) PostBuild(fn func(*Kong)error) Option {
return OptionFunc(func (k *Kong) error {
k.postBuildOptions = append(k.postBuildOptions, OptionFunc(fn))
return nil
})
}
// Name overrides the application name.
func Name(name string) Option {
return OptionFunc(func(k *Kong) error {