private static void errorMissingEquals(String label) { MainExitException mee; mee = new MainExitException(1, "missing argument for --" + label + "\n"); mee.setUsageError(true); throw mee; }
private Status handleMainExit(MainExitException mee) { if (!mee.isAborted()) { config.getError().println(mee.getMessage()); if (mee.isUsageError()) { doPrintUsage(true); } } return new Status(mee.getStatus()); }
private void disallowedInRubyOpts(CharSequence option) { if (rubyOpts) { throw new MainExitException(1, "jruby: invalid switch in RUBYOPT: " + option + " (RuntimeError)"); } }
private void disallowedInRubyOpts(CharSequence option) { if (rubyOpts) { throw new MainExitException(1, "jruby: invalid switch in RUBYOPT: " + option + " (RuntimeError)"); } }
private Status handleMainExit(MainExitException mee) { if (!mee.isAborted()) { config.getError().println(mee.getMessage()); if (mee.isUsageError()) { doPrintUsage(true); } } return new Status(mee.getStatus()); }
private static void errorMissingEquals(String label) { MainExitException mee; mee = new MainExitException(1, "missing argument for --" + label + "\n"); mee.setUsageError(true); throw mee; }
private void processEncodingOption(String value) { List<String> encodings = StringSupport.split(value, ':', 3); switch (encodings.size()) { case 3: throw new MainExitException(1, "extra argument for -E: " + encodings.get(2)); case 2: config.setInternalEncoding(encodings.get(1)); case 1: config.setExternalEncoding(encodings.get(0)); // Zero is impossible } }
private Status handleMainExit(MainExitException mee) { if (!mee.isAborted()) { config.getOutput().println(mee.getMessage()); if (mee.isUsageError()) { doPrintUsage(true); } } return new Status(mee.getStatus()); }
private String grabValue(String errorMessage) { String optValue = grabOptionalValue(); if (optValue != null) { return optValue; } argumentIndex++; if (argumentIndex < arguments.size()) { return arguments.get(argumentIndex).originalValue; } MainExitException mee = new MainExitException(1, errorMessage); mee.setUsageError(true); throw mee; }
private void processEncodingOption(String value) { List<String> encodings = StringSupport.split(value, ':', 3); switch (encodings.size()) { case 3: throw new MainExitException(1, "extra argument for -E: " + encodings.get(2)); case 2: config.setInternalEncoding(encodings.get(1)); case 1: config.setExternalEncoding(encodings.get(0)); // Zero is impossible } }
private Status handleMainExit(MainExitException mee) { if (!mee.isAborted()) { config.getOutput().println(mee.getMessage()); if (mee.isUsageError()) { doPrintUsage(true); } } return new Status(mee.getStatus()); }
private String grabValue(String errorMessage, boolean usageError) { String optValue = grabOptionalValue(); if (optValue != null) { return optValue; } argumentIndex++; if (argumentIndex < arguments.size()) { return arguments.get(argumentIndex).originalValue; } MainExitException mee = new MainExitException(1, errorMessage); if (usageError) mee.setUsageError(true); throw mee; }
private void processEncodingOption(String value) { String[] encodings = value.split(":", 3); switch (encodings.length) { case 3: throw new MainExitException(1, "extra argument for -E: " + encodings[2]); case 2: config.setInternalEncoding(encodings[1]); case 1: config.setExternalEncoding(encodings[0]); // Zero is impossible } }
private String grabValue(String errorMessage, boolean usageError) { String optValue = grabOptionalValue(); if (optValue != null) { return optValue; } argumentIndex++; if (argumentIndex < arguments.size()) { return arguments.get(argumentIndex).originalValue; } MainExitException mee = new MainExitException(1, errorMessage); if (usageError) mee.setUsageError(true); throw mee; }
private void processEncodingOption(String value) { String[] encodings = value.split(":", 3); switch (encodings.length) { case 3: throw new MainExitException(1, "extra argument for -E: " + encodings[2]); case 2: config.setInternalEncoding(encodings[1]); case 1: config.setExternalEncoding(encodings[0]); // Zero is impossible } }
private String grabValue(String errorMessage) { String optValue = grabOptionalValue(); if (optValue != null) { return optValue; } argumentIndex++; if (argumentIndex < arguments.size()) { return arguments.get(argumentIndex).originalValue; } MainExitException mee = new MainExitException(1, errorMessage); mee.setUsageError(true); throw mee; }
return new BufferedInputStream(is, 8129); throw new MainExitException(1, "Error opening script file: " + e.getMessage());
config.setRecordSeparator("" + (char) val); } catch (Exception e) { MainExitException mee = new MainExitException(1, getArgumentError(" -0 must be followed by either 0, 777, or a valid octal value")); mee.setUsageError(true); throw mee; MainExitException mee = new MainExitException(1, "jruby: Can't chdir to " + saved + " (fatal)"); throw mee; MainExitException mee = new MainExitException(1, getArgumentError(" -C must be followed by a valid directory")); throw mee; config.setVerbosity(RubyInstanceConfig.Verbosity.TRUE); } else { MainExitException mee = new MainExitException(1, getArgumentError(" -W must be followed by either 0, 1, 2 or nothing")); mee.setUsageError(true); throw mee; MainExitException mee = new MainExitException(1, "jruby: Can't chdir to " + saved + " (fatal)"); throw mee; MainExitException mee = new MainExitException(1, getArgumentError(" -x must be followed by a valid directory")); throw mee; if (extendedOption == null) { if (SafePropertyAccessor.getBoolean("jruby.launcher.nopreamble", false)) { throw new MainExitException(0, OutputStrings.getExtendedHelp()); } else { throw new MainExitException(0, "jruby: missing argument\n" + OutputStrings.getExtendedHelp());
return new BufferedInputStream(is, 8129); throw new MainExitException(1, "Error opening script file: " + e.getMessage());
config.setRecordSeparator("" + (char) val); } catch (Exception e) { MainExitException mee = new MainExitException(1, getArgumentError(" -0 must be followed by either 0, 777, or a valid octal value")); mee.setUsageError(true); throw mee; MainExitException mee = new MainExitException(1, "jruby: Can't chdir to " + saved + " (fatal)"); throw mee; MainExitException mee = new MainExitException(1, getArgumentError(" -C must be followed by a valid directory")); throw mee; config.setVerbosity(RubyInstanceConfig.Verbosity.TRUE); } else { MainExitException mee = new MainExitException(1, getArgumentError(" -W must be followed by either 0, 1, 2 or nothing")); mee.setUsageError(true); throw mee; MainExitException mee = new MainExitException(1, "jruby: Can't chdir to " + saved + " (fatal)"); throw mee; MainExitException mee = new MainExitException(1, getArgumentError(" -x must be followed by a valid directory")); throw mee; if (extendedOption == null) { if (SafePropertyAccessor.getBoolean("jruby.launcher.nopreamble", false)) { throw new MainExitException(0, OutputStrings.getExtendedHelp()); } else { throw new MainExitException(0, "jruby: missing argument\n" + OutputStrings.getExtendedHelp());