Skip to content

Commit b49144c

Browse files
committed
Fix JRUBY-6357: jruby-launcher gem dumps help message to STDERR
1 parent 0893442 commit b49144c

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

ng.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ void processnailgunstream() {
314314
break;
315315
case CHUNKTYPE_EXIT: processExit(buf, len);
316316
break;
317-
default: fprintf(stderr, "Unexpected chunk type %d ('%c')\n", chunkType, chunkType);
317+
default: fprintf(stdout, "Unexpected chunk type %d ('%c')\n", chunkType, chunkType);
318318
cleanUpAndExit(NAILGUN_UNEXPECTED_CHUNKTYPE);
319319
}
320320
/*}*/
@@ -451,24 +451,24 @@ int isNailgunClientName(char *s) {
451451
*/
452452
void usage(int exitcode) {
453453

454-
fprintf(stderr, "Usage: ng class [--nailgun-options] [args]\n");
455-
fprintf(stderr, " (to execute a class)\n");
456-
fprintf(stderr, " or: ng alias [--nailgun-options] [args]\n");
457-
fprintf(stderr, " (to execute an aliased class)\n");
458-
fprintf(stderr, " or: alias [--nailgun-options] [args]\n");
459-
fprintf(stderr, " (to execute an aliased class, where \"alias\"\n");
460-
fprintf(stderr, " is both the alias for the class and a symbolic\n");
461-
fprintf(stderr, " link to the ng client)\n\n");
462-
463-
fprintf(stderr, "where options include:\n");
464-
fprintf(stderr, " --nailgun-D<name>=<value> set/override a client environment variable\n");
465-
fprintf(stderr, " --nailgun-version print product version and exit\n");
466-
fprintf(stderr, " --nailgun-showversion print product version and continue\n");
467-
fprintf(stderr, " --nailgun-server to specify the address of the nailgun server\n");
468-
fprintf(stderr, " (default is localhost)\n");
469-
fprintf(stderr, " --nailgun-port to specify the port of the nailgun server\n");
470-
fprintf(stderr, " (default is 2113)\n");
471-
fprintf(stderr, " --nailgun-help print this message and exit\n");
454+
fprintf(stdout, "Usage: ng class [--nailgun-options] [args]\n");
455+
fprintf(stdout, " (to execute a class)\n");
456+
fprintf(stdout, " or: ng alias [--nailgun-options] [args]\n");
457+
fprintf(stdout, " (to execute an aliased class)\n");
458+
fprintf(stdout, " or: alias [--nailgun-options] [args]\n");
459+
fprintf(stdout, " (to execute an aliased class, where \"alias\"\n");
460+
fprintf(stdout, " is both the alias for the class and a symbolic\n");
461+
fprintf(stdout, " link to the ng client)\n\n");
462+
463+
fprintf(stdout, "where options include:\n");
464+
fprintf(stdout, " --nailgun-D<name>=<value> set/override a client environment variable\n");
465+
fprintf(stdout, " --nailgun-version print product version and exit\n");
466+
fprintf(stdout, " --nailgun-showversion print product version and continue\n");
467+
fprintf(stdout, " --nailgun-server to specify the address of the nailgun server\n");
468+
fprintf(stdout, " (default is localhost)\n");
469+
fprintf(stdout, " --nailgun-port to specify the port of the nailgun server\n");
470+
fprintf(stdout, " (default is 2113)\n");
471+
fprintf(stdout, " --nailgun-help print this message and exit\n");
472472

473473
cleanUpAndExit(exitcode);
474474
}
@@ -557,7 +557,7 @@ int nailgunClientMain(int argc, char *argv[], char *env[]) {
557557
hostinfo = gethostbyname(nailgun_server);
558558

559559
if (hostinfo == NULL) {
560-
fprintf(stderr, "Unknown host: %s\n", nailgun_server);
560+
fprintf(stdout, "Unknown host: %s\n", nailgun_server);
561561
cleanUpAndExit(NAILGUN_CONNECT_FAILED);
562562
}
563563

platformlauncher.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ bool PlatformLauncher::checkJDKHome() {
210210
return false;
211211
}
212212
} else {
213-
fprintf(stderr, "%s\n", errMsg.c_str());
213+
fprintf(stdout, "%s\n", errMsg.c_str());
214214
return false;
215215
}
216216
}
@@ -233,7 +233,7 @@ bool PlatformLauncher::checkJDKHome() {
233233
return false;
234234
}
235235
} else {
236-
fprintf(stderr, "%s\n", errMsg.c_str());
236+
fprintf(stdout, "%s\n", errMsg.c_str());
237237
return false;
238238
}
239239
} else {

utilsfuncs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void logV(bool appendSysError, bool showMsgBox, const char *format, va_list args
202202
::MessageBox(NULL, msg, "JRuby Error", MB_OK | MB_ICONSTOP);
203203
}
204204
#endif
205-
fprintf(stderr, "%s\n", msg);
205+
fprintf(stdout, "%s\n", msg);
206206
}
207207
}
208208

@@ -242,7 +242,7 @@ bool checkLoggingArg(int argc, char *argv[], bool delFile) {
242242
}
243243

244244
bool printToConsole(const char *msg) {
245-
fprintf(stderr, "%s", msg);
245+
fprintf(stdout, "%s", msg);
246246
return false;
247247
}
248248

0 commit comments

Comments
 (0)