func NewCommandDispatcher(fetcher pfxFetcher, core *Core) *CommandDispatcher {
	return &CommandDispatcher{
		Core:    core,
		fetcher: fetcher,
		trie:    newTrie(false),
	}
}
NewCommandDispatcher initializes a cmds.
package dispatch
import (
	"fmt"
	"reflect"
	"strings"
	"sync"
	"github.com/aarondl/ultimateq/data"
	"github.com/aarondl/ultimateq/dispatch/cmd"
	"github.com/aarondl/ultimateq/irc"
	"github.com/pkg/errors"
)
const (
	errFmtInternal     = "cmd: Internal Error Occurred: %v"
	errFmtDuplicateCmd = `cmd: ` +
		`Duplicate command registration attempted (%v)`
	errMsgCmdRequired     = `cmd: Cmd name cannot be empty.`
	errMsgExtRequired     = `cmd: Extension name cannot be empty.`
	errMsgDescRequired    = `cmd: Description cannot be empty.`
	errMsgHandlerRequired = `cmd: Handler required for command registration.`
	errMsgStoreDisabled = "Access Denied: Cannot use authenticated commands, " +
		"nick or user parameters when store is disabled."
	errMsgStateDisabled = "Error: Cannot use nick or user parameter commands " +
		"when state is disabled."
	errMsgNotAuthed = "Access Denied: You are not authenticated. " +
		"To authenticate message me: auth <password>. " +
		"To create an account message me: register <password>."
	errFmtInsuffLevel        = "Access Denied: (%v) level required."
	errFmtInsuffGlobalLevel  = "Access Denied: (%v) global level required."
	errFmtInsuffServerLevel  = "Access Denied: (%v) server level required."
	errFmtInsuffChannelLevel = "Access Denied: (%v) channel level required."
	errFmtInsuffFlags        = "Access Denied: (%v) flag(s) required."
	errFmtInsuffGlobalFlags  = "Access Denied: (%v) global flag(s) required."
	errFmtInsuffServerFlags  = "Access Denied: (%v) server flag(s) required."
	errFmtInsuffChannelFlags = "Access Denied: (%v) channel flag(s) required."
	errFmtCmdNotFound        = `Error: Command not found (%v), try "help".`
	errFmtAmbiguousCmd       = "Error: Ambiguous command (%v) found matching:" +
		` [%v], try "help".`
	errFmtUserNotRegistered = "Error: User [%v] is not registered."
	errFmtUserNotAuthed     = "Error: User [%v] is not authenticated."
	errFmtUserNotFound      = "Error: User [%v] could not be found."
)
type pfxFetcher func(network, channel string) rune
type CommandDispatcher struct {
	*Core
	fetcher pfxFetcher
	mutTrie sync.RWMutex
	trie    *trie
}