mirror of
https://github.com/crazy-max/diun.git
synced 2024-12-22 19:38:28 +00:00
17 lines
310 B
Go
17 lines
310 B
Go
package kong
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
// Parse constructs a new parser and parses the default command-line.
|
|
func Parse(cli interface{}, options ...Option) *Context {
|
|
parser, err := New(cli, options...)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
ctx, err := parser.Parse(os.Args[1:])
|
|
parser.FatalIfErrorf(err)
|
|
return ctx
|
|
}
|