AddCmd with Name having spaces causes the command to not execute
- 主要语言
- Go
- 星标
- 1.8k
- 派生
- 213
- PR 合并指标
- 30 天内没有已合并 PR
描述
using this example raises the error `Error: incorrect input, try 'help'`:
```go
shell.AddCmd(&ishell.Cmd{
Name: "test cmd example",
Help: "test cmd",
LongHelp: "Turn syslog OFF.",
Func: func(c *ishell.Context) {
c.Println("test")
},
})
```
tried like this:
```go
{
ishell_cmd := &ishell.Cmd{
Name: "test",
Help: "test func",
}
ishell_cmd.AddCmd(&ishell.Cmd{
Name: "cmd example",
Help: "cmd example help text",
LongHelp: "Turn syslog OFF.",
Func: func(c *ishell.Context) {
c.Println("test")
},
})
shell.AddCmd(ishell_cmd)
}
```
makes it print the help:
```
>>> test cmd example
test func
Commands:
cmd example cmd example help text
```
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。