ProcessCommands processes command list.
(out string, cmds Commands)
| 49 | |
| 50 | // ProcessCommands processes command list. |
| 51 | func ProcessCommands(out string, cmds Commands) { |
| 52 | params := GuessParams(cmds) |
| 53 | |
| 54 | data := cmds.toJSON() |
| 55 | if out != "" { |
| 56 | err := ioutil.WriteFile(out, data, 0644) |
| 57 | if err != nil { |
| 58 | panic(err) |
| 59 | } |
| 60 | fmt.Printf("Written commands to %s\n", out) |
| 61 | return |
| 62 | } |
| 63 | |
| 64 | StartServer(":2000", data, params) |
| 65 | } |
| 66 | |
| 67 | // Usage prints usage information, overriding default one. |
| 68 | func Usage() { |
no test coverage detected