hotspot/src/share/vm/runtime/arguments.cpp
changeset 18497 9ff60555fcd3
parent 18493 752f5cbc2ba6
child 18510 b4df166cc411
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Mon Jul 01 09:30:23 2013 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Fri Jun 28 20:18:04 2013 -0700
@@ -849,7 +849,7 @@
     arg_len = equal_sign - argname;
   }
 
-  Flag* found_flag = Flag::find_flag((char*)argname, arg_len, true);
+  Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true);
   if (found_flag != NULL) {
     char locked_message_buf[BUFLEN];
     found_flag->get_locked_message(locked_message_buf, BUFLEN);
@@ -870,6 +870,14 @@
   } else {
     jio_fprintf(defaultStream::error_stream(),
                 "Unrecognized VM option '%s'\n", argname);
+    Flag* fuzzy_matched = Flag::fuzzy_match((const char*)argname, arg_len, true);
+    if (fuzzy_matched != NULL) {
+      jio_fprintf(defaultStream::error_stream(),
+                  "Did you mean '%s%s%s'?\n",
+                  (fuzzy_matched->is_bool()) ? "(+/-)" : "",
+                  fuzzy_matched->name,
+                  (fuzzy_matched->is_bool()) ? "" : "=<value>");
+    }
   }
 
   // allow for commandline "commenting out" options like -XX:#+Verbose