func (c *Command) MustRun(args []string) {
	if err := c.Run(args); err != nil {
		color.Error.Println("ERROR:", err.Error())
		panic(err)
	}
}
MustRun Alone the current command, will panic on error

Usage:
// run with os.Args
cmd.MustRun(nil)
cmd.MustRun(os.Args[1:])
// custom args
cmd.MustRun([]string{"-a", ...})
package gcli
import (
	"errors"
	"flag"
	"fmt"
	"os"
	"strings"
	"text/template"
	"github.com/gookit/color"
	"github.com/gookit/gcli/v3/helper"
	"github.com/gookit/goutil/structs"
	"github.com/gookit/goutil/strutil"
)
type Runner interface {
	Run(c *Command, args []string) error
}
type RunnerFunc func(c *Command, args []string) error
func (f RunnerFunc) Run(c *Command, args []string) error {
	return f(c, args)
}
const maxFunc = 64
type HandlersChain []RunnerFunc
func (c HandlersChain) Last() RunnerFunc {
	length := len(c)
	if length > 0 {
		return c[length-1]
	}
	return nil
}
type Command struct {
	core
	commandBase
	Flags
	Arguments
	Name string
	Desc string
	Aliases []string
	Category string
	Config func(c *Command)
	Hidden bool
	runErr error
	middleIdx int8
	middles HandlersChain
	pathNames []string
	parent *Command
	Subs []*Command
	Examples string
	Func RunnerFunc
	Help string
	HelpRender func(c *Command)
	app *App
	disabled bool
	standalone bool
	goptBounded bool
}
func NewCommand(name, desc string, fn ...func(c *Command)) *Command {
	c := &Command{
		Name: name,
		Desc: desc,
	}
	if len(fn) > 0 {
		c.Config = fn[0]
	}
	c.Arguments.SetName(name)
	return c
}
func (c *Command) Init() {
	c.initialize()
}
func (c *Command) SetFunc(fn RunnerFunc) {
	c.Func = fn
}
func (c *Command) WithFunc(fn RunnerFunc) *Command {
	c.Func = fn
	return c
}
func (c *Command) WithHidden() *Command {
	c.Hidden = true
	return c
}
func (c *Command) AttachTo(app *App) {
	app.AddCommand(c)
}
func (c *Command) Disable() {
	c.disabled = true
}
func (c *Command) Visible() bool {
	return c.Hidden == false
}
func (c *Command) IsDisabled() bool {
	return c.disabled
}
func (c *Command) Runnable() bool {
	return c.Func != nil
}
func (c *Command) Add(sub *Command, more ...*Command) {
	c.AddSubs(sub, more...)
}
func (c *Command) AddSubs(sub *Command, more ...*Command) {
	c.AddCommand(sub)
	if len(more) > 0 {
		for _, cmd := range more {
			c.AddCommand(cmd)
		}
	}
}
func (c *Command) AddCommand(sub *Command) {
	sub.app = c.app
	sub.parent = c
	sub.standalone = c.standalone
	sub.core.gFlags = c.gFlags
	c.initialize()
	sub.pathNames = c.pathNames[0:]
	c.commandBase.addCommand(c.Name, sub)
}
func (c *Command) Match(names []string) *Command {
	c.initialize()
	ln := len(names)
	if ln == 0 {  
		return c
	}
	return c.commandBase.Match(names)
}
func (c *Command) MatchByPath(path string) *Command {
	return c.Match(splitPath2names(path))
}
func (c *Command) initialize() {
	if c.initialized {
		return
	}
	cName := c.goodName()
	Debugf("initialize the command '%s'", cName)
	c.initialized = true
	c.pathNames = append(c.pathNames, cName)
	c.initCore(cName)
	c.initCommandBase()
	if len(c.Subs) > 0 {
		for _, sub := range c.Subs {
			c.AddCommand(sub)
		}
	}
	c.Arguments.SetName(cName)
	c.Arguments.SetValidateNum(gOpts.strictMode)
	c.Flags.SetOptions(newDefaultFlagOption())
	c.Flags.InitFlagSet(cName)
	if len(c.Desc) > 0 {
		c.Desc = strutil.UpperFirst(c.Desc)
		if strings.Contains(c.Desc, "{$cmd}") {
			c.Desc = strings.Replace(c.Desc, "{$cmd}", c.Name, -1)
		}
	}
	if c.Config != nil {
		c.Config(c)
	}
	c.Fire(EvtCmdInit, nil)
}
func (c *Command) initCore(cName string) {
	Logf(VerbCrazy, "init command c.core for the command: %s", cName)
	c.core.cmdLine = CLI
	if c.core.Hooks == nil {
		c.core.Hooks = &Hooks{}
	}
	c.AddVars(c.innerHelpVars())
	c.AddVars(map[string]string{
		"cmd": cName,
		"binWithCmd": c.binName + " " + cName,
		"fullCmd": c.binFile + " " + cName,
	})
}
func (c *Command) initCommandBase() {
	Logf(VerbCrazy, "init command c.commandBase for the command: %s", c.Name)
	c.commandBase.cmdNames = make(map[string]int)
	c.commandBase.commands = make(map[string]*Command)
	c.commandBase.nameMaxWidth = 12
	c.commandBase.cmdAliases = structs.NewAliases(aliasNameCheck)
}
func (c *Command) Next() {
	c.middleIdx++
	s := int8(len(c.middles))
	for ; c.middleIdx < s; c.middleIdx++ {
		err := c.middles[c.middleIdx](c, c.RawArgs())
		if err != nil {
			c.runErr = err
			return
		}
	}
}
var errCallRunOnApp = errors.New("c.Run() method can only be called in standalone mode")
var errCallRunOnSub = errors.New("c.Run() cannot allow call at subcommand")