|
|
@ -45,9 +45,18 @@ func RunShell(options ShellOptions) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
for _, c := range strings.Split(cmd, ";") { |
|
|
|
if processEachCmd(reg, c, commandEnv) { |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func processEachCmd(reg *regexp.Regexp, cmd string, commandEnv *CommandEnv) bool { |
|
|
|
cmds := reg.FindAllString(cmd, -1) |
|
|
|
if len(cmds) == 0 { |
|
|
|
continue |
|
|
|
return false |
|
|
|
} else { |
|
|
|
line.AppendHistory(cmd) |
|
|
|
|
|
|
@ -61,7 +70,7 @@ func RunShell(options ShellOptions) { |
|
|
|
if cmd == "help" || cmd == "?" { |
|
|
|
printHelp(cmds) |
|
|
|
} else if cmd == "exit" || cmd == "quit" { |
|
|
|
return |
|
|
|
return true |
|
|
|
} else { |
|
|
|
foundCommand := false |
|
|
|
for _, c := range Commands { |
|
|
@ -78,7 +87,7 @@ func RunShell(options ShellOptions) { |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
func printGenericHelp() { |
|
|
|