< prev index next >

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

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

*** 50,71 **** private boolean mainArgs; private String hostname; private HostIdentifier hostId; public static void printUsage(PrintStream ps) { ! ps.println("usage: jps [-help]"); ps.println(" jps [-q] [-mlvV] [<hostid>]"); ps.println(); ps.println("Definitions:"); ps.println(" <hostid>: <hostname>[:<port>]"); } public Arguments(String[] args) throws IllegalArgumentException { int argc = 0; if (args.length == 1) { if ((args[0].compareTo("-?") == 0) || (args[0].compareTo("-help")== 0)) { help = true; return; } } --- 50,75 ---- private boolean mainArgs; private String hostname; private HostIdentifier hostId; public static void printUsage(PrintStream ps) { ! ps.println("usage: jps [-? -h --help]"); ps.println(" jps [-q] [-mlvV] [<hostid>]"); ps.println(); ps.println("Definitions:"); ps.println(" <hostid>: <hostname>[:<port>]"); + ps.println(" -? -h --help: Prints this help message."); } public Arguments(String[] args) throws IllegalArgumentException { int argc = 0; if (args.length == 1) { if ((args[0].compareTo("-?") == 0) + || (args[0].compareTo("-h")== 0) + || (args[0].compareTo("--help")== 0) + // -help: legacy. Undocumented. || (args[0].compareTo("-help")== 0)) { help = true; return; } }
< prev index next >