func (cr *CommandRegistry) Register(name interface{}) *Command {
	var nameString string
	if _, ok := name.(string); name != nil && !ok {
		fmt.Printf("Error: value of the command must be a string.\n")
		os.Exit(0)
	}
	if name == nil {
		nameString = rootCommandName
	} else {
		nameString = name.(string)
	}
	_name := removeWhitespaces(nameString)  
	c := cr.addCommand(_name)
	if _name == rootCommandName {
		c.AddFlag(fmt.Sprintf("%s,%s", versionFlagName, versionFlagShortName), versionFlagDesc, Bool, nil)
	}
	c.AddFlag(fmt.Sprintf("%s,%s", helpFlagName, helpFlagShortName), helpFlagDesc, Bool, nil)
	return c
}
Register registers a command in the registry and adds `--help` flag automatically.
If the root-command is registered, it adds the `--version` flags to display the version.
The "name" argument must be a string. If `nil` is passed, the root-command is registered.
package commando
import (
	"fmt"
	"os"
	"strconv"
	"strings"
	"text/template"
	"github.com/thatisuday/clapper"
)
const (
	Bool = iota
	Int
	String
)
var rootCommandName = ""
var (
	helpCommandName         = "help"
	helpCommandDesc         = "This command displays the usage information of this CLI application."
	helpCommandShortDesc    = "displays usage information"
	versionCommandName      = "version"
	versionCommandDesc      = "This command displays the version number of this CLI application"
	versionCommandShortDesc = "displays version number"
	helpFlagName            = "help"
	helpFlagShortName       = "h"
	helpFlagDesc            = "displays usage information of the application or a command"
	versionFlagName         = "version"
	versionFlagShortName    = "v"
	versionFlagDesc         = "displays version number"
)
const (
	EventVersion = "version"
	EventHelp    = "help"
)
func isRootCommand(command string) bool {
	return command == rootCommandName
}
func removeWhitespaces(value string) string {
	return strings.ReplaceAll(value, " ", "")
}
func trimWhitespaces(value string) string {
	return strings.Trim(value, " ")
}
type CommandRegistry struct {
	Executable string
	Version string
	Desc string
	Commands map[string]*Command
	EventListener func(string)
	registry clapper.Registry
}
func (cr *CommandRegistry) addCommand(name string) *Command {
	clpCommandConfig, exists := cr.registry.Register(name)
	if exists {
		return cr.Commands[clpCommandConfig.Name]
	}
	c := &Command{
		clpCommandConfig: clpCommandConfig,
		IsRoot:           clpCommandConfig.Name == rootCommandName,
		Args:             make(map[string]*Arg),
		Flags:            make(map[string]*Flag),
	}
	cr.Commands[clpCommandConfig.Name] = c
	return c
}
func (cr *CommandRegistry) SetExecutableName(name string) *CommandRegistry {
	if _name := removeWhitespaces(name); _name == "" {
		fmt.Printf("Error: executable name must be a non-empty string.\n")
		os.Exit(0)
	} else {
		cr.Executable = _name
	}
	return cr
}
func (cr *CommandRegistry) SetVersion(version string) *CommandRegistry {
	cr.Version = trimWhitespaces(version)  
	return cr
}
func (cr *CommandRegistry) SetDescription(desc string) *CommandRegistry {
	cr.Desc = trimWhitespaces(desc)  
	return cr
}
func (cr *CommandRegistry) SetEventListener(listener func(string)) *CommandRegistry {
	if cr.EventListener == nil {
		cr.EventListener = listener
	}
	return cr
}