< prev index next >
src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java
Print this page
rev 48074 : 8189102: All tools should support -?, -h and --help
Reviewed-by: kvn, jjg, weijun, alanb, rfield, ksrini
*** 1,7 ****
/*
! * Copyright (c) 2011, 2012, 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
--- 1,7 ----
/*
! * 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,58 ****
/* list all processes */
processString = "0";
return;
}
! if (args[0].equals("-h") || args[0].equals("-help") ) {
showUsage = true;
return;
}
processString = args[0];
--- 48,62 ----
/* list all processes */
processString = "0";
return;
}
! if (args[0].equals("-?") ||
! args[0].equals("-h") ||
! args[0].equals("--help") ||
! // -help: legacy.
! args[0].equals("-help")) {
showUsage = true;
return;
}
processString = args[0];
*** 114,121 ****
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 ");
}
}
--- 118,125 ----
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 --help print this help message ");
}
}
< prev index next >