Skip to content

Commit bebe7e9

Browse files
committed
Merge branch 'master' of [email protected]:jruby/jruby-launcher
2 parents 8af7278 + d2d9c31 commit bebe7e9

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

argparser.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2010 JRuby Team (www.jruby.org).
2+
* Copyright 2009-2011 JRuby Team (www.jruby.org).
33
*/
44

55
#include <cstring>
@@ -41,8 +41,9 @@ Options:\n\
4141
-Xprop.erty[=value] equivalent to -J-Djruby.<prop.erty>[=value]\n\
4242
-Xproperties list supported properties (omit \"jruby.\" with -X)\n"
4343
#ifdef WIN32
44-
" -Xconsole <mode> jrubyw console attach mode (new|attach|suppress)\n\n"
44+
" -Xconsole <mode> jrubyw console attach mode (new|attach|suppress)\n"
4545
#endif
46+
"\n"
4647
;
4748

4849
const char *ArgParser::REQ_JAVA_VERSION = "1.5";
@@ -314,8 +315,8 @@ bool ArgParser::parseArgs(int argc, char *argv[]) {
314315
if (!appendHelp.empty()) {
315316
printToConsole(appendHelp.c_str());
316317
}
317-
progArgs.push_back("-Xnopreamble");
318-
return false;
318+
javaOptions.push_back("-Djruby.launcher.nopreamble=true");
319+
progArgs.push_back("-X");
319320
} else if (strcmp(it->c_str(), "-Xversion") == 0) {
320321
printToConsole("JRuby Launcher Version " JRUBY_LAUNCHER_VERSION "\n");
321322
return false;

spec/launcher_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
end
1111

1212
it "should print help message" do
13-
jruby_launcher("-Xhelp 2>&1").should =~ /JRuby Launcher usage/
14-
jruby_launcher("-X 2>&1").should =~ /JRuby Launcher usage/
13+
args = jruby_launcher_args("-Xhelp 2>&1")
14+
args.detect{|l| l =~ /JRuby Launcher usage/}.should be_true
15+
args[-1].should == "-X"
16+
args = jruby_launcher_args("-X 2>&1")
17+
args.detect{|l| l =~ /JRuby Launcher usage/}.should be_true
18+
args[-1].should == "-X"
1519
end
1620

1721
it "should use $JAVACMD when JAVACMD is specified" do

0 commit comments

Comments
 (0)