Use variadic options to configure Kong.
This commit is contained in:
@@ -2,8 +2,9 @@ package kong
|
||||
|
||||
import "os"
|
||||
|
||||
func Parse(cli interface{}) {
|
||||
parser, err := New("", "", cli)
|
||||
// Parse constructs a new parser and parses the default command-line.
|
||||
func Parse(cli interface{}, options ...Option) {
|
||||
parser, err := New(cli, options...)
|
||||
parser.FatalIfErrorf(err)
|
||||
_, err = parser.Parse(os.Args[1:])
|
||||
parser.FatalIfErrorf(err)
|
||||
|
||||
Reference in New Issue
Block a user