(s *Shell)
| 20 | } |
| 21 | |
| 22 | func addDefaultFuncs(s *Shell) { |
| 23 | s.AddCmd(&Cmd{ |
| 24 | Name: "exit", |
| 25 | Help: "exit the program", |
| 26 | Func: exitFunc, |
| 27 | }) |
| 28 | s.AddCmd(&Cmd{ |
| 29 | Name: "help", |
| 30 | Help: "display help", |
| 31 | Func: helpFunc, |
| 32 | }) |
| 33 | s.AddCmd(&Cmd{ |
| 34 | Name: "clear", |
| 35 | Help: "clear the screen", |
| 36 | Func: clearFunc, |
| 37 | }) |
| 38 | s.Interrupt(interruptFunc) |
| 39 | } |
| 40 | |
| 41 | func interruptFunc(c *Context, count int, line string) { |
| 42 | if count >= 2 { |
no test coverage detected