< prev index next >

langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java

Print this page

        

@@ -142,11 +142,11 @@
             return true;
         }
     }
 
     static Option[] recognizedOptions = {
-        new Option(false, "-h", "-?", "-help") {
+        new Option(false, "-h", "-?", "-help", "--help") {
             void process(JdepsTask task, String opt, String arg) {
                 task.options.help = true;
             }
         },
         new Option(true, "-dotoutput") {

@@ -193,18 +193,18 @@
         new Option(false, "-apionly") {
             void process(JdepsTask task, String opt, String arg) {
                 task.options.apiOnly = true;
             }
         },
-        new Option(true, "-check") {
+        new Option(true, "--check") {
             void process(JdepsTask task, String opt, String arg) throws BadArgs {
                 Set<String> mods =  Set.of(arg.split(","));
                 task.options.checkModuleDeps = mods;
                 task.options.addmods.addAll(mods);
             }
         },
-        new Option(true, "-genmoduleinfo") {
+        new Option(true, "--gen-module-info") {
             void process(JdepsTask task, String opt, String arg) throws BadArgs {
                 Path p = Paths.get(arg);
                 if (Files.exists(p) && (!Files.isDirectory(p) || !Files.isWritable(p))) {
                     throw new BadArgs("err.invalid.path", arg);
                 }

@@ -220,26 +220,26 @@
                 }
             }
         },
 
         // ---- paths option ----
-        new Option(true, "-cp", "-classpath") {
+        new Option(true, "-cp", "-classpath", "--class-path") {
             void process(JdepsTask task, String opt, String arg) {
                 task.options.classpath = arg;
             }
         },
-        new Option(true, "-mp", "-modulepath") {
+        new Option(true, "--module-path") {
             void process(JdepsTask task, String opt, String arg) throws BadArgs {
                 task.options.modulePath = arg;
             }
         },
-        new Option(true, "-upgrademodulepath") {
+        new Option(true, "--upgrade-module-path") {
             void process(JdepsTask task, String opt, String arg) throws BadArgs {
                 task.options.upgradeModulePath = arg;
             }
         },
-        new Option(true, "-system") {
+        new Option(true, "--system") {
             void process(JdepsTask task, String opt, String arg) throws BadArgs {
                 if (arg.equals("none")) {
                     task.options.systemModulePath = null;
                 } else {
                     Path path = Paths.get(arg);

@@ -248,17 +248,17 @@
                     else
                         throw new BadArgs("err.invalid.path", arg);
                 }
             }
         },
-        new Option(true, "-addmods") {
+        new Option(true, "--add-modules") {
             void process(JdepsTask task, String opt, String arg) throws BadArgs {
                 Set<String> mods = Set.of(arg.split(","));
                 task.options.addmods.addAll(mods);
             }
         },
-        new Option(true, "-m") {
+        new Option(true, "-m", "--module") {
             void process(JdepsTask task, String opt, String arg) throws BadArgs {
                 task.options.rootModule = arg;
                 task.options.addmods.add(arg);
             }
         },

@@ -312,11 +312,11 @@
                 task.options.includePattern = Pattern.compile(arg);
             }
         },
 
         // Another alternative to list modules in -addmods option
-        new HiddenOption(true, "-include-system-modules") {
+        new HiddenOption(true, "--include-system-modules") {
             void process(JdepsTask task, String opt, String arg) throws BadArgs {
                 task.options.includeSystemModulePattern = Pattern.compile(arg);
             }
         },
 

@@ -343,11 +343,11 @@
                 task.options.filterSamePackage = true;
                 task.options.filterSameArchive = true;
             }
         },
 
-        new Option(false, "-ct", "-compile-time") {
+        new Option(false, "--compile-time") {
             void process(JdepsTask task, String opt, String arg) {
                 task.options.compileTimeView = true;
                 task.options.filterSamePackage = true;
                 task.options.filterSameArchive = true;
                 task.options.depth = 0;

@@ -373,11 +373,11 @@
         new HiddenOption(false, "-showlabel") {
             void process(JdepsTask task, String opt, String arg) {
                 task.options.showLabel = true;
             }
         },
-        new HiddenOption(false, "-hide-module") {
+        new HiddenOption(false, "--hide-show-module") {
             void process(JdepsTask task, String opt, String arg) {
                 task.options.showModule = false;
             }
         },
         new HiddenOption(true, "-depth") {

@@ -462,11 +462,11 @@
             if (options.showSummary && options.verbose != SUMMARY) {
                 showHelp();
                 return EXIT_CMDERR;
             }
             if (options.checkModuleDeps != null && !inputArgs.isEmpty()) {
-                reportError("err.invalid.module.option", inputArgs, "-check");
+                reportError("err.invalid.module.option", inputArgs, "--check");
             }
 
             boolean ok = run();
             return ok ? EXIT_OK : EXIT_ERROR;
         } catch (BadArgs|UncheckedBadArgs e) {

@@ -499,16 +499,16 @@
             Stream.concat(options.addmods.stream(), options.requires.stream())
                 .filter(mn -> !config.isValidToken(mn))
                 .forEach(mn -> config.findModule(mn).orElseThrow(() ->
                     new UncheckedBadArgs(new BadArgs("err.module.not.found", mn))));
 
-            // -genmoduleinfo
+            // --gen-module-info
             if (options.genModuleInfo != null) {
                 return genModuleInfo(config);
             }
 
-            // -check
+            // --check
             if (options.checkModuleDeps != null) {
                 return new ModuleAnalyzer(config, log, options.checkModuleDeps).run();
             }
 
             if (options.dotOutputDir != null &&
< prev index next >