internal/cmdflag/cmdflag.go
func New(name, argsdesc, desc string, errh flag.ErrorHandling, initializer func(*flag.FlagSet) Handler) {
	sub := &subcmd{
		errh:     errh,
		name:     name,
		argsdesc: argsdesc,
		desc:     desc,
		ini:      initializer,
	}

	mu.Lock()
	defer mu.Unlock()
	for _, sub := range subs {
		if sub.name == name {
			panic(fmt.Errorf("cmdflag %s redeclared", name))
		}
	}
	subs = append(subs, sub)
}
func New(name, argsdesc, desc string, errh flag.ErrorHandling, initializer func(*flag.FlagSet) Handler) {
	sub := &subcmd{
		errh:     errh,
		name:     name,
		argsdesc: argsdesc,
		desc:     desc,
		ini:      initializer,
	}

	mu.Lock()
	defer mu.Unlock()
	for _, sub := range subs {
		if sub.name == name {
			panic(fmt.Errorf("cmdflag %s redeclared", name))
		}
	}
	subs = append(subs, sub)
}
// New instantiates a new cmdflag with its name and description.
//
// It is safe to be called from multiple go routines (typically in init functions).
//
// The cmdflag initializer is called only when the cmdflag is present on the command line.
// The handler is called with the remaining arguments once the cmdflag flags have been parsed successfully.
//
// It will panic if the cmdflag already exists.