func NewNamedParser(appname string, options Options) *Parser {
	p := &Parser{
		Command:            newCommand(appname, "", "", nil),
		Options:            options,
		NamespaceDelimiter: ".",
	}
	p.Command.parent = p
	return p
}
NewNamedParser creates a new parser. The appname is used to display the
executable name in the built-in help message. Option groups and commands can
be added to this parser by using AddGroup and AddCommand.
package flags
import (
	"bytes"
	"fmt"
	"os"
	"path"
	"sort"
	"strings"
	"unicode/utf8"
)
type Parser struct {
	*Command
	Usage string
	Options Options
	NamespaceDelimiter string
	UnknownOptionHandler func(option string, arg SplitArgument, args []string) ([]string, error)
	CompletionHandler func(items []Completion)
	CommandHandler func(command Commander, args []string) error
	internalError error
}
type SplitArgument interface {
	Value() (string, bool)
}
type strArgument struct {
	value *string
}
func (s strArgument) Value() (string, bool) {
	if s.value == nil {
		return "", false
	}
	return *s.value, true
}
type Options uint
const (
	None Options = 0
	HelpFlag = 1 << iota
	PassDoubleDash
	IgnoreUnknown
	PrintErrors
	PassAfterNonOption
	Default = HelpFlag | PrintErrors | PassDoubleDash
)
type parseState struct {
	arg        string
	args       []string
	retargs    []string
	positional []*Arg
	err        error
	command *Command
	lookup  lookup
}
func Parse(data interface{}) ([]string, error) {
	return NewParser(data, Default).Parse()
}
func ParseArgs(data interface{}, args []string) ([]string, error) {
	return NewParser(data, Default).ParseArgs(args)
}
func NewParser(data interface{}, options Options) *Parser {
	p := NewNamedParser(path.Base(os.Args[0]), options)
	if data != nil {
		g, err := p.AddGroup("Application Options", "", data)
		if err == nil {
			g.parent = p
		}
		p.internalError = err
	}
	return p
}