diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/RscriptCommand.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/RscriptCommand.java index 25c2493fb47a242e01d59000863c8affd1a28b3c..1bb5fd576612a8e598875eafe3e3f4ccc0c11950 100644 --- a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/RscriptCommand.java +++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/RscriptCommand.java @@ -60,7 +60,7 @@ public class RscriptCommand { // Either -e options are set or first non-option arg is a file if (options.getStringList(EXPR) == null) { if (firstNonOptionArgIndex == resultArgsLength) { - System.err.println("filename is missing"); + RCmdOptions.printHelp(RCmdOptions.Client.RSCRIPT, 0); Utils.exit(2); } else { options.setValue(FILE, arguments[firstNonOptionArgIndex]); diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/Utils.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/Utils.java index 536fd2bd6d69f5b205f13bfa26c6b80a1ac043bb..5fea2d6cdb1165fae92073bc34a1347e685a5a71 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/Utils.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/Utils.java @@ -127,7 +127,7 @@ public final class Utils { */ public static RuntimeException exit(int status) { RPerfStats.report(); - if (RContext.getInstance().getOptions().getString(RCmdOption.DEBUGGER) != null) { + if (RContext.getInstance() != null && RContext.getInstance().getOptions() != null && RContext.getInstance().getOptions().getString(RCmdOption.DEBUGGER) != null) { throw new DebugExitException(); } else { try {