Merge "Fix "dalvikvm -help"."
diff --git a/vm/Init.cpp b/vm/Init.cpp
index 21214d6..4e547d3 100644
--- a/vm/Init.cpp
+++ b/vm/Init.cpp
@@ -80,8 +80,9 @@
*
* We follow the tradition of unhyphenated compound words.
*/
-static void usage(const char* progName)
+static void usage()
{
+ const char* progName = "dalvikvm";
dvmFprintf(stderr, "%s: [options] class [argument ...]\n", progName);
dvmFprintf(stderr, "%s: [options] -jar file.jar [argument ...]\n",progName);
dvmFprintf(stderr, "\n");
@@ -803,7 +804,8 @@
for (i = 0; i < argc; i++) {
if (strcmp(argv[i], "-help") == 0) {
/* show usage and stop */
- return -1;
+ usage();
+ exit(0);
} else if (strcmp(argv[i], "-version") == 0) {
/* show version and stop */
@@ -1389,7 +1391,7 @@
if (cc != 0) {
if (cc < 0) {
dvmFprintf(stderr, "\n");
- usage("dalvikvm");
+ usage();
}
return "syntax error";
}