Default DebugCommands() to include null replay

This commit is contained in:
Derek Parker
2014-05-21 10:18:54 -05:00
parent c125fafe50
commit 2d8cc08513
2 changed files with 4 additions and 6 deletions

View File

@ -11,9 +11,11 @@ type Commands struct {
cmds map[string]cmdfunc
}
// Returns a Commands struct with default commands defined.
func DebugCommands() *Commands {
cmds := map[string]cmdfunc{
"exit": exitFunc,
"": nullCommand,
}
return &Commands{cmds}
@ -29,10 +31,6 @@ func (c *Commands) Register(cmdstr string, cf cmdfunc) {
func (c *Commands) Find(cmdstr string) cmdfunc {
cmd, ok := c.cmds[cmdstr]
if !ok {
if cmdstr == "" {
return nullCommand
}
return noCmdAvailable
}