< prev index next >

src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java

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


 491         try {
 492             while (!args.isEmpty()) {
 493                 String a = args.element();
 494                 if (a.startsWith("-")) {
 495                     args.remove();
 496                     switch (a) {
 497                         case "--class-path":
 498                             classPath.clear();
 499                             Arrays.stream(args.remove().split(File.pathSeparator))
 500                                   .map(File::new)
 501                                   .forEachOrdered(classPath::add);
 502                             break;
 503                         case "--for-removal":
 504                             forRemoval = true;
 505                             break;
 506                         case "--full-version":
 507                             out.println(System.getProperty("java.vm.version"));
 508                             return false;
 509                         case "--help":
 510                         case "-h":

 511                             out.println(Messages.get("main.usage"));
 512                             out.println();
 513                             out.println(Messages.get("main.help"));
 514                             return false;
 515                         case "-l":
 516                         case "--list":
 517                             require(scanMode == ScanMode.ARGS);
 518                             scanMode = ScanMode.LIST;
 519                             break;
 520                         case "--release":
 521                             loadMode = LoadMode.RELEASE;
 522                             release = args.remove();
 523                             if (!validReleases.contains(release)) {
 524                                 throw new UsageException();
 525                             }
 526                             break;
 527                         case "-v":
 528                         case "--verbose":
 529                             verbose = true;
 530                             break;




 491         try {
 492             while (!args.isEmpty()) {
 493                 String a = args.element();
 494                 if (a.startsWith("-")) {
 495                     args.remove();
 496                     switch (a) {
 497                         case "--class-path":
 498                             classPath.clear();
 499                             Arrays.stream(args.remove().split(File.pathSeparator))
 500                                   .map(File::new)
 501                                   .forEachOrdered(classPath::add);
 502                             break;
 503                         case "--for-removal":
 504                             forRemoval = true;
 505                             break;
 506                         case "--full-version":
 507                             out.println(System.getProperty("java.vm.version"));
 508                             return false;
 509                         case "--help":
 510                         case "-h":
 511                         case "-?":
 512                             out.println(Messages.get("main.usage"));
 513                             out.println();
 514                             out.println(Messages.get("main.help"));
 515                             return false;
 516                         case "-l":
 517                         case "--list":
 518                             require(scanMode == ScanMode.ARGS);
 519                             scanMode = ScanMode.LIST;
 520                             break;
 521                         case "--release":
 522                             loadMode = LoadMode.RELEASE;
 523                             release = args.remove();
 524                             if (!validReleases.contains(release)) {
 525                                 throw new UsageException();
 526                             }
 527                             break;
 528                         case "-v":
 529                         case "--verbose":
 530                             verbose = true;
 531                             break;


< prev index next >