File: global.go

package info (click to toggle)
golang-github-alecthomas-kong 0.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 620 kB
  • sloc: makefile: 2
file content (16 lines) | stat: -rw-r--r-- 310 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
}