func (cmd *Command) SetIsServer(yes bool) {
	cmd.Root().isServer = yes
}
SetIsServer sets command running mode(server or not)
package cli
import (
	"bytes"
	"fmt"
	"io"
	"net/http"
	"os"
	"regexp"
	"sort"
	"strings"
	"sync"
	"github.com/labstack/gommon/color"
	"github.com/mattn/go-colorable"
)
var commandNameRegexp = regexp.MustCompile("^[a-zA-Z_0-9][a-zA-Z_\\-0-9]*$")
func IsValidCommandName(commandName string) bool {
	return commandNameRegexp.MatchString(commandName)
}
type (
	CommandFunc func(*Context) error
	ArgvFunc func() interface{}
	NumCheckFunc func(n int) bool
	UsageFunc func() string
)
func ExactN(num int) NumCheckFunc { return func(n int) bool { return n == num } }
func AtLeast(num int) NumCheckFunc { return func(n int) bool { return n >= num } }
func AtMost(num int) NumCheckFunc { return func(n int) bool { return n <= num } }
type (
	Command struct {
		Name    string    
		Aliases []string  
		Desc    string    
		Text    string    
		CanSubRoute bool
		NoHook bool
		Global bool
		Fn        CommandFunc   
		UsageFn   UsageFunc     
		Argv      ArgvFunc      
		NumArg    NumCheckFunc  
		NumOption NumCheckFunc  
		HTTPRouters []string
		HTTPMethods []string
		OnBefore func(*Context) error
		OnAfter  func(*Context) error
		OnRootPrepareError func(error) error
		OnRootBefore       func(*Context) error
		OnRootAfter        func(*Context) error
		routersMap map[string]string
		parent   *Command
		children []*Command
		isServer bool
		locker     sync.Mutex  
		usage      string
		usageStyle UsageStyle
	}
	CommandTree struct {
		command *Command
		forest  []*CommandTree
	}
)
func (cmd *Command) Register(child *Command) *Command {
	if child == nil {
		panic("command `" + cmd.Name + "` try register a nil command")
	}
	if !IsValidCommandName(child.Name) {
		panic("illegal command name `" + cmd.Name + "`")
	}
	if cmd.children == nil {
		cmd.children = []*Command{}
	}
	if child.parent != nil {
		panic("command `" + child.Name + "` has been child of `" + child.parent.Name + "`")
	}
	if cmd.findChild(child.Name) != nil {
		panic("repeat register child `" + child.Name + "` for command `" + cmd.Name + "`")
	}
	if child.Aliases != nil {
		for _, alias := range child.Aliases {
			if cmd.findChild(alias) != nil {
				panic("repeat register child `" + alias + "` for command `" + cmd.Name + "`")
			}
		}
	}
	cmd.children = append(cmd.children, child)
	child.parent = cmd
	return child
}
func (cmd *Command) RegisterFunc(name string, fn CommandFunc, argvFn ArgvFunc) *Command {
	return cmd.Register(&Command{Name: name, Fn: fn, Argv: argvFn})
}
func (cmd *Command) RegisterTree(forest ...*CommandTree) {
	for _, tree := range forest {
		cmd.Register(tree.command)
		if tree.forest != nil && len(tree.forest) > 0 {
			tree.command.RegisterTree(tree.forest...)
		}
	}
}
func (cmd *Command) Parent() *Command {
	return cmd.parent
}
func (cmd *Command) IsServer() bool {
	return cmd.isServer
}
func (cmd *Command) IsClient() bool {
	return !cmd.IsServer()
}