"Simply" runs a command. Yep. @param input The command String to parse and run. i.e: "echo Hello world!" @param ps1 The ps1 to be inserted when outputting to the console. i.e: "root@system:~# " @param termArea (Ohh, boy!) A JavaFX label to output to. This serves as the Terminal "log" per-sa
(String input, String ps1, Label termArea)
| 205 | * @see exitcode.Console#printText(Label, String) |
| 206 | */ |
| 207 | public void runCommand(String input, String ps1, Label termArea) { |
| 208 | ArrayList<String> output = formatCommand(input); |
| 209 | String command = output.get(0); |
| 210 | String body = output.get(1); |
| 211 | printText(termArea, String.format("%n%s%s", ps1, input)); |
| 212 | if (checkCommand(command)) { |
| 213 | exeCommand(command, termArea, body); |
| 214 | } else { |
| 215 | if (!(command.trim().equals(""))) { |
| 216 | printText(termArea, ("\"" + command + "\" is not a valid command.")); |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * Executes the Command. First, checks if exePrivate() was able to run the command. |
nothing calls this directly
no test coverage detected