in misc/j0hnny_5/server.go [273:335]
func process_double(cmd_array []string, unlocked bool, staged bool) (string, bool, bool) {
var rsp string
arg0, arg1 := cmd_array[0], cmd_array[1]
if !unlocked {
switch arg0 {
case "help":
switch arg1 {
case "command":
rsp = "Issue a command" // Intentionally not helpful
case "test":
rsp = "Reboot and perform a robot POST"
case "list":
rsp = "List available commands"
default:
rsp = "help ??"
}
case "command":
switch arg1 {
case "access_code":
rsp = "must supply unlock code"
case "self_destruct":
rsp = ":( .... I am ALIVE!"
default:
rsp = "unknown argument for function " + arg0
}
default:
rsp = "unknown command or argument"
}
} else { // it is unlocked
switch arg0 {
case "help":
switch arg1 {
case "execute":
rsp = "Supply a firmware update related command"
case "download":
rsp = "Download and stage a firmware update"
case "show":
rsp = "List a directory or the default folder"
case "upload":
rsp = "Upload listing and upload firmware update to the target directory"
default:
rsp = "help ??"
}
case "command":
switch arg1 {
case "access_code":
rsp = "must supply unlock code"
default:
rsp = "unknown argument for function " + arg0
}
case "execute":
rsp = process_execute(arg1, staged)
case "show":
rsp = process_show(arg1, staged)
case "download":
rsp, staged = process_download(arg1, staged)
case "upload":
rsp = process_upload(arg1)
}
}
return rsp, unlocked, staged
}