< prev index next >

src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.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) 2005, 2013, 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) 2005, 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
*** 54,64 **** while (optionCount < args.length) { String arg = args[optionCount]; if (!arg.startsWith("-")) { break; } ! if (arg.equals("-help") || arg.equals("-h")) { usage(0); } else { if (arg.equals("-l")) { locks = true; --- 54,68 ---- while (optionCount < args.length) { String arg = args[optionCount]; if (!arg.startsWith("-")) { break; } ! if (arg.equals("-?") || ! arg.equals("-h") || ! arg.equals("--help") || ! // -help: legacy. ! arg.equals("-help")) { usage(0); } else { if (arg.equals("-l")) { locks = true;
*** 169,177 **** System.err.println(" jstack [-l] <pid>"); System.err.println(" (to connect to running process)"); System.err.println(""); System.err.println("Options:"); System.err.println(" -l long listing. Prints additional information about locks"); ! System.err.println(" -h or -help to print this help message"); System.exit(exit); } } --- 173,181 ---- System.err.println(" jstack [-l] <pid>"); System.err.println(" (to connect to running process)"); System.err.println(""); System.err.println("Options:"); System.err.println(" -l long listing. Prints additional information about locks"); ! System.err.println(" -? -h --help -help to print this help message"); System.exit(exit); } }
< prev index next >