func (f *FlagSet) ErrHandling(ehs ...ErrorHandling) *FlagSet {
	var e ErrorHandling
	for _, eh := range ehs {
		e |= eh
	}
	f.errorHandling = e
	for i := range f.subsets {
		f.subsets[i].ErrHandling(f.errorHandling)
	}
	return f
}
ErrHandling change the way of error handling
package flag
import (
	"bytes"
	"fmt"
	"os"
	"path/filepath"
	"text/tabwriter"
)
type Flag struct {
	Names     string       
	Arglist   string       
	Usage     string       
	Desc      string       
	descLines []string     
	Ptr       interface{}  
	Default interface{}  
	Selects interface{}  
	Env     string       
	ValSep  string       
	Version      string     
	versionLines []string   
	ArgsPtr      *[]string  
	ArgsAnywhere bool       
}
type Metadata interface {
	Metadata() map[string]Flag
}
type NoFlag interface {
	NoFlag()
}
type ErrorHandling uint8
const (
	ErrPanic ErrorHandling = 1 << iota
	ErrPrint
	ErrExit
	DefaultErrorHandling = ErrPrint | ErrExit
)
func (e ErrorHandling) do(eh ErrorHandling) bool {
	return e&eh != 0
}
func (e ErrorHandling) handle(err error) error {
	if err == nil {
		return nil
	}
	if e.do(ErrPanic) {
		panic(err)
	}
	if e.do(ErrPrint) {
		fmt.Fprintln(os.Stderr, err)
	}
	if e.do(ErrExit) {
		os.Exit(2)
	}
	return err
}
type FlagSet struct {
	self Flag
	flags       []Flag
	flagIndexes map[string]int
	subsets       []FlagSet
	subsetIndexes map[string]int
	errorHandling   ErrorHandling
	noHelpFlag      bool
	helpFlagDefined bool
}
func NewFlagSet(flag Flag) *FlagSet {
	if flag.Names == "" {
		flag.Names = filepath.Base(os.Args[0])
	}
	return newFlagSet(flag)
}
func newFlagSet(flag Flag) *FlagSet {
	defaultRegister.cleanFlag(&flag)
	return &FlagSet{
		self:          flag,
		flagIndexes:   make(map[string]int),
		subsetIndexes: make(map[string]int),
		errorHandling: DefaultErrorHandling,
	}
}
func (f *FlagSet) searchFlag(name string) *Flag {
	index, has := f.flagIndexes[name]
	if !has {
		return nil
	}
	return &f.flags[index]
}
func (f *FlagSet) isFlag(name string) bool {
	_, has := f.flagIndexes[name]
	return has
}
func (f *FlagSet) isSubset(name string) bool {
	_, has := f.subsetIndexes[name]
	return has
}
func (f *FlagSet) isFlagOrSubset(name string) bool {
	return f.isFlag(name) || f.isSubset(name)
}
func (f *FlagSet) UpdateMeta(children string, meta Flag) error {
	return defaultRegister.updateMeta(f, children, meta)
}