diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-07-28 12:23:52 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-07-28 12:23:52 +0200 |
| commit | 7234fd04b63e69756670e3605a4e778cbe6cf871 (patch) | |
| tree | c1a37a9b40378c041bcba4b39db57e06be10f94f /src/main/java/com/c2kernel/process/ClientShell.java | |
| parent | 7b3b3c6d26742fc6c2bd9ce4f9b0df1c19686e66 (diff) | |
Support pre-compilation of scripts if supported by the engine. Also does
this during testing to catch script syntax errors during build. Client
shell detects these error and declares them pre-execution.
Diffstat (limited to 'src/main/java/com/c2kernel/process/ClientShell.java')
| -rw-r--r-- | src/main/java/com/c2kernel/process/ClientShell.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/c2kernel/process/ClientShell.java b/src/main/java/com/c2kernel/process/ClientShell.java index f109155..7456ba7 100644 --- a/src/main/java/com/c2kernel/process/ClientShell.java +++ b/src/main/java/com/c2kernel/process/ClientShell.java @@ -5,6 +5,7 @@ import java.util.Scanner; import com.c2kernel.entity.proxy.AgentProxy;
import com.c2kernel.process.auth.Authenticator;
import com.c2kernel.scripting.Script;
+import com.c2kernel.scripting.ScriptParsingException;
public class ClientShell extends StandardClient {
@@ -21,13 +22,15 @@ public class ClientShell extends StandardClient { System.out.print("> ");
while (scan.hasNextLine()) {
String command = scan.nextLine();
- console.setScript(command);
try {
+ console.setScript(command);
Object response = console.execute();
if (response == null)
System.out.println("Ok");
else
System.out.println(response);
+ } catch (ScriptParsingException e) {
+ System.err.println("Syntax error: "+e.getMessage());
} catch (Throwable ex) {
ex.printStackTrace();
}
|
