< prev index next >

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

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

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

@@ -135,11 +135,15 @@
                 action = 2;
             } else if (args[i].equals("-l")) {
                 lifetime = getTime(Config.duration(args[++i]));
             } else if (args[i].equals("-r")) {
                 renewable_lifetime = getTime(Config.duration(args[++i]));
-            } else if (args[i].equalsIgnoreCase("-help")) {
+            } else if (args[i].equalsIgnoreCase("-?") ||
+                       args[i].equalsIgnoreCase("-h") ||
+                       args[i].equalsIgnoreCase("--help") ||
+                       // -help: legacy. Undocumented.
+                       args[i].equalsIgnoreCase("-help")) {
                 printHelp();
                 System.exit(0);
             } else if (p == null) { // Haven't yet processed a "principal"
                 p = args[i];
                 try {

@@ -246,10 +250,11 @@
         System.out.println("\t-k   use keytab");
         System.out.println("\t-t   keytab file name");
         System.out.println("\tprincipal   the principal name "+
                 "(i.e., qweadf@ATHENA.MIT.EDU qweadf)");
         System.out.println("\tpassword    the principal's Kerberos password");
+        System.out.println("\t-? -h --help Print this help message");
     }
 
     public boolean getAddressOption() {
         return includeAddresses;
     }
< prev index next >