< prev index next >

src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java

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


 183                         throw new BadArgs("error.bad.reason", arg);
 184                     }
 185                 }
 186                 boolean isExtra() { return true; }
 187             },
 188             new Option(false, OptionType.CREATE_UPDATE_INDEX, "--no-compress", "-0") {
 189                 void process(Main jartool, String opt, String arg) {
 190                     jartool.flag0 = true;
 191                 }
 192             },
 193 
 194             // Hidden options
 195             new Option(false, OptionType.OTHER, "-P") {
 196                 void process(Main jartool, String opt, String arg) {
 197                     jartool.pflag = true;
 198                 }
 199                 boolean isHidden() { return true; }
 200             },
 201 
 202             // Other options
 203             new Option(true, true, OptionType.OTHER, "--help", "-h") {
 204                 void process(Main jartool, String opt, String arg) throws BadArgs {
 205                     if (jartool.info == null) {
 206                         if (arg == null) {
 207                             jartool.info = GNUStyleOptions::printHelp;  //  Main.Info.HELP;
 208                             return;
 209                         }
 210                         if (!arg.equals("compat"))
 211                             throw new BadArgs("error.illegal.option", arg).showUsage(true);
 212                         // jartool.info = Main.Info.COMPAT_HELP;
 213                         jartool.info = GNUStyleOptions::printCompatHelp;
 214                     }
 215                 }
 216             },
 217             new Option(false, OptionType.OTHER, "--help-extra") {
 218                 void process(Main jartool, String opt, String arg) throws BadArgs {
 219                     jartool.info = GNUStyleOptions::printHelpExtra;
 220                 }
 221             },
 222             new Option(false, OptionType.OTHER, "--version") {
 223                 void process(Main jartool, String opt, String arg) {




 183                         throw new BadArgs("error.bad.reason", arg);
 184                     }
 185                 }
 186                 boolean isExtra() { return true; }
 187             },
 188             new Option(false, OptionType.CREATE_UPDATE_INDEX, "--no-compress", "-0") {
 189                 void process(Main jartool, String opt, String arg) {
 190                     jartool.flag0 = true;
 191                 }
 192             },
 193 
 194             // Hidden options
 195             new Option(false, OptionType.OTHER, "-P") {
 196                 void process(Main jartool, String opt, String arg) {
 197                     jartool.pflag = true;
 198                 }
 199                 boolean isHidden() { return true; }
 200             },
 201 
 202             // Other options
 203             new Option(true, true, OptionType.OTHER, "--help", "-h", "-?") {
 204                 void process(Main jartool, String opt, String arg) throws BadArgs {
 205                     if (jartool.info == null) {
 206                         if (arg == null) {
 207                             jartool.info = GNUStyleOptions::printHelp;  //  Main.Info.HELP;
 208                             return;
 209                         }
 210                         if (!arg.equals("compat"))
 211                             throw new BadArgs("error.illegal.option", arg).showUsage(true);
 212                         // jartool.info = Main.Info.COMPAT_HELP;
 213                         jartool.info = GNUStyleOptions::printCompatHelp;
 214                     }
 215                 }
 216             },
 217             new Option(false, OptionType.OTHER, "--help-extra") {
 218                 void process(Main jartool, String opt, String arg) throws BadArgs {
 219                     jartool.info = GNUStyleOptions::printHelpExtra;
 220                 }
 221             },
 222             new Option(false, OptionType.OTHER, "--version") {
 223                 void process(Main jartool, String opt, String arg) {


< prev index next >