6990390: javah -help produces help screen with extraneous output
Reviewed-by: darcy
--- a/langtools/src/share/classes/com/sun/tools/javah/resources/l10n.properties Thu Oct 07 15:26:32 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/resources/l10n.properties Mon Oct 11 10:19:57 2010 -0700
@@ -94,7 +94,7 @@
\ -d <dir> Output directory
main.opt.v=\
\ -v -verbose Enable verbose output
-main.opt.help=\
+main.opt.h=\
\ -h --help -? Print this message
main.opt.version=\
\ -version Print version information
--- a/langtools/test/tools/javah/TestHelpOpts.java Thu Oct 07 15:26:32 2010 -0700
+++ b/langtools/test/tools/javah/TestHelpOpts.java Mon Oct 11 10:19:57 2010 -0700
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6893932
+ * @bug 6893932 6990390
* @summary javah help screen lists -h and -? but does not accept them
*/
@@ -68,6 +68,8 @@
String flat = out.replaceAll("\\s+", " "); // canonicalize whitespace
if (!flat.contains("Usage: javah [options] <classes> where [options] include:"))
error("expected text not found");
+ if (flat.contains("main.opt"))
+ error("key not found in resource bundle: " + flat.replaceAll(".*(main.opt.[^ ]*).*", "$1"));
}
void error(String msg) {