public static void main()

in modules/jdktools/src/main/java/org/apache/harmony/tools/javap/Main.java [66:124]


    public static void main(String args[]) {
        if (args.length < 1) {
            usage();
            System.exit(1);
        }

        String pathSep = null;
        try {
            pathSep = System.getProperty("path.separator");
        } catch (SecurityException e) {
            // ignore
        }
        
        Set names = new HashSet();
        Map options = new HashMap();
        int i = 0;
        while (i < args.length) {
            if (args[i].equals("-bootclasspath") 
                    || args[i].equals("-classpath")
                    || args[i].equals("-extdirs")) {
                String path = (String) args[i + 1];

                // Process the "-extdirs" option as "-bootclasspath".
                String opt = (String) args[i];
                if (opt.equals("-extdirs")) {
                    opt = "-bootclasspath";
                }

                // We can concatenate several options, if there is no 
                // security restriction; otherwise, the new option replaces
                // the old one.
                if (pathSep != null) {
                    String prevPath = (String) options.get(opt);
                    if (prevPath != null) {
                        path = prevPath + pathSep + path;
                    }
                }

                options.put(opt, path);
                i++;
            } else if (args[i].equals("-c") 
                    || args[i].equals("-package")
                    || args[i].equals("-public")
                    || args[i].equals("-protected")
                    || args[i].equals("-private")
                    || args[i].equals("-l")
                    || args[i].equals("-s")
                    || args[i].equals("-inner")
                    || args[i].equals("-verbose")) {
                options.put(args[i], Boolean.valueOf(true));
            } else if (args[i].startsWith("-")) {
                System.err.println("Unknown option: " + args[i]);
            } else {
                names.add(args[i]);
            }
            i++;
        }
        System.exit(run(options, names));
    }