Codebase list golang-github-alecthomas-kong / 9c19b2d3-dc8b-41a0-9c9a-78506f97c374/upstream/sid global.go
9c19b2d3-dc8b-41a0-9c9a-78506f97c374/upstream/sid

Tree @9c19b2d3-dc8b-41a0-9c9a-78506f97c374/upstream/sid (Download .tar.gz)

global.go @9c19b2d3-dc8b-41a0-9c9a-78506f97c374/upstream/sidraw · history · blame

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
}