Skip to content

Commit 90b3cc8

Browse files
committed
Add -Xproperties to list properties (equivalent to --properties)
1 parent 19d7ef1 commit 90b3cc8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

argparser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Options:\n\
3939
-Xtrace <path> path for launcher log (for troubleshooting)\n\
4040
-Xcommand just print the equivalent java command and exit\n\
4141
-Xprop.erty[=value] equivalent to -J-Djruby.<prop.erty>[=value]\n\
42-
see --properties for a list (omit \"jruby.\" with -X\n"
42+
-Xproperties list supported properties (omit \"jruby.\" with -X)\n"
4343
#ifdef WIN32
4444
" -Xconsole <mode> jrubyw console attach mode (new|attach|suppress)\n\n"
4545
#endif
@@ -318,6 +318,8 @@ bool ArgParser::parseArgs(int argc, char *argv[]) {
318318
} else if (strcmp(it->c_str(), "-Xversion") == 0) {
319319
printToConsole("JRuby Launcher Version " JRUBY_LAUNCHER_VERSION "\n");
320320
return false;
321+
} else if (strcmp(it->c_str(), "-Xproperties") == 0) {
322+
progArgs.push_back(std::string("--properties"));
321323
} else if (it->compare(0, 2, "-X", 2) == 0 && islower(it->c_str()[2])) {
322324
// Any other /-X([a-z].*)/ get turned into a -Djruby.\1 property
323325
std::string propPart = it->substr(2);

spec/launcher_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
jruby_launcher_args("-Xprop.erty=value").should include("-Djruby.prop.erty=value")
6565
end
6666

67+
it "should pass -Xproperties as --properties" do
68+
jruby_launcher_args("-Xproperties").should include("--properties")
69+
end
70+
6771
it "should default to 500m max heap" do
6872
jruby_launcher_args("").should include("-Xmx500m", "-Djruby.memory.max=500m")
6973
end

0 commit comments

Comments
 (0)