< prev index next >

src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java

Print this page
rev 47855 : 8189102: All tools should support -?, -h and --help

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -48,11 +48,12 @@
             /* list all processes */
             processString = "0";
             return;
         }
 
-        if (args[0].equals("-h") || args[0].equals("-help") ) {
+        // -help: legacy. Undocumented.
+        if (args[0].equals("-?") || args[0].equals("-h") || args[0].equals("--help") || args[0].equals("-help")) {
             showUsage = true;
             return;
         }
 
         processString = args[0];

@@ -114,8 +115,8 @@
         System.out.println("  If no options are given, lists Java processes (same as -l).     ");
         System.out.println("                                                                  ");
         System.out.println("  PerfCounter.print display the counters exposed by this process  ");
         System.out.println("  -f  read and execute commands from the file                     ");
         System.out.println("  -l  list JVM processes on the local machine                     ");
-        System.out.println("  -h  this help                                                   ");
+        System.out.println("  -? -h --help print this help message                            ");
     }
 }
< prev index next >