Skip to content

Commit 8950054

Browse files
committed
jruby -Xhelp should not crash
1 parent fc69e71 commit 8950054

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

argparser.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ using namespace std;
2323

2424
const char *ArgParser::HELP_MSG =
2525
"JRuby Launcher usage: jruby" EXEEXT " {options} arguments\n\n\
26+
To see general JRuby options, type 'jruby -h' or 'jruby --help'.\n\n\
2627
Options:\n\
2728
-Xversion print launcher's version\n\
2829
\nJvm Management:\n\
@@ -42,7 +43,7 @@ Options:\n\
4243
#ifdef WIN32
4344
" -Xconsole <mode> jrubyw console attach mode (new|attach|suppress)\n\n"
4445
#endif
45-
"To see general JRuby options, type 'jruby -h' or 'jruby --help'.\n";
46+
;
4647

4748
const char *ArgParser::REQ_JAVA_VERSION = "1.5";
4849

@@ -313,6 +314,10 @@ bool ArgParser::parseArgs(int argc, char *argv[]) {
313314
if (!appendHelp.empty()) {
314315
printToConsole(appendHelp.c_str());
315316
}
317+
progArgs.push_back("-Xnopreamble");
318+
return false;
319+
} else if (strcmp(it->c_str(), "-Xversion") == 0) {
320+
printToConsole("JRuby Launcher Version " JRUBY_LAUNCHER_VERSION "\n");
316321
return false;
317322
} else if (strcmp(it->c_str(), "-Xversion") == 0) {
318323
printToConsole("JRuby Launcher Version " JRUBY_LAUNCHER_VERSION "\n");

0 commit comments

Comments
 (0)