MCPcopy Index your code
hub / github.com/abiosoft/ishell / addDefaultFuncs

Function addDefaultFuncs

functions.go:22–39  ·  view source on GitHub ↗
(s *Shell)

Source from the content-addressed store, hash-verified

20}
21
22func 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
41func interruptFunc(c *Context, count int, line string) {
42 if count >= 2 {

Callers 1

NewWithReadlineFunction · 0.85

Calls 2

InterruptMethod · 0.80
AddCmdMethod · 0.45

Tested by

no test coverage detected