committed by
Alec Thomas
parent
184735e689
commit
3eb5e285ed
@@ -3,9 +3,10 @@ package kong
|
||||
import "os"
|
||||
|
||||
// Parse constructs a new parser and parses the default command-line.
|
||||
func Parse(cli interface{}, options ...Option) {
|
||||
func Parse(cli interface{}, options ...Option) string {
|
||||
parser, err := New(cli, options...)
|
||||
parser.FatalIfErrorf(err)
|
||||
_, err = parser.Parse(os.Args[1:])
|
||||
cmd, err := parser.Parse(os.Args[1:])
|
||||
parser.FatalIfErrorf(err)
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user