mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 18:27:37 +08:00
Add ability to register commands
This commit is contained in:
@ -19,6 +19,10 @@ func DebugCommands() *Commands {
|
||||
return &Commands{cmds}
|
||||
}
|
||||
|
||||
func (c *Commands) Register(cmdstr string, cf cmdfunc) {
|
||||
c.cmds[cmdstr] = cf
|
||||
}
|
||||
|
||||
func (c *Commands) Find(cmdstr string) cmdfunc {
|
||||
cmd, ok := c.cmds[cmdstr]
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user