< prev index next >

src/java.security.jgss/windows/classes/sun/security/krb5/internal/tools/Ktab.java

Print this page
rev 48495 : 8189102: All tools should support -?, -h and --help
Reviewed-by: kvn, jjg, weijun, alanb, rfield, ksrini

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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

@@ -70,12 +70,18 @@
      * The main program that can be invoked at command line.
      * See {@link #printHelp} for usages.
      */
     public static void main(String[] args) {
         Ktab ktab = new Ktab();
-        if ((args.length == 1) && (args[0].equalsIgnoreCase("-help"))) {
+        if ((args.length == 1) &&
+            ((args[0].equalsIgnoreCase("-?")) ||
+             (args[0].equalsIgnoreCase("-h")) ||
+             (args[0].equalsIgnoreCase("--help")) ||
+             // -help: legacy.
+             (args[0].equalsIgnoreCase("-help")))) {
             ktab.printHelp();
+            System.exit(0);
             return;
         } else if ((args == null) || (args.length == 0)) {
             ktab.action = 'l';
         } else {
             ktab.processArgs(args);
< prev index next >