On 添加指令
(arg string, callback func())
| 119 | |
| 120 | // On 添加指令 |
| 121 | func (this *AppCmd) On(arg string, callback func()) { |
| 122 | this.directives = append(this.directives, &Directive{ |
| 123 | Arg: arg, |
| 124 | Callback: callback, |
| 125 | }) |
| 126 | } |
| 127 | |
| 128 | // Run 运行 |
| 129 | func (this *AppCmd) Run(main func()) { |