ap.add("level", "DTED level to consider (0, 1, 2).", 1);
ap.add("level", "DTED level to consider (0, 1, 2), 0 is default.  Needs to be set for other levels.", 1);
    public static void main(String[] argv) {        Debug.init();        ArgParser ap = new ArgParser("DTEDAdmin");        ap.add("boundary", "upper lat, left lon, lower lat, right lon", 4, true);        ap.add("copy", "Copy files to DTED directory.", 1);        ap.add("level", "DTED level to consider (0, 1, 2).", 1);        ap.add("outside", "Use files outside boundary.");        ap.add("query", "Print out files that meet parameters.");        ap.add("remove", "Delete DTED files.");        ap.add("source", "The source DTED directory path.", 1);        ap.add("verbose", "Print out progress.");        if (!ap.parse(argv)) {            ap.printUsage();            System.exit(0);        }                String arg[];        String sourceDir = null;        arg = ap.getArgValues("source");        if (arg != null) {            sourceDir = arg[0];        }        boolean inside = true;        arg = ap.getArgValues("outside");        if (arg != null) {            inside = false;        }        int level = 0;        arg = ap.getArgValues("level");        if (arg != null) {            try {                level = Integer.parseInt(arg[0]);            } catch (NumberFormatException nfe) {                level = 0;            }        }        arg = ap.getArgValues("verbose");        if (arg != null) {            Debug.put("dted");        }        DTEDAdmin admin = null;        double ullat = 89;        double ullon = -180;        double lrlat = -90;        double lrlon = 179;        arg = ap.getArgValues("boundary");        if (arg != null) {            try {                ullat = Double.parseDouble(arg[0]);                ullon = Double.parseDouble(arg[1]);                lrlat = Double.parseDouble(arg[2]);                lrlon = Double.parseDouble(arg[3]);            } catch (NumberFormatException nfe1) {                Debug.error("DTEDAdmin: boundary coordinates not valid:\n" +                            "  " + arg[0] +                             "\n  " + arg[1] +                             "\n  " + arg[2] +                             "\n  " + arg[3]);                System.exit(0);            }        }        if (sourceDir != null) {            admin = new DTEDAdmin(sourceDir,                                  ullat, ullon, lrlat, lrlon,                                  level, inside, DTEDAdmin.DTED_EQUAL_LEVELS);        }        arg = ap.getArgValues("copy");        if (arg != null) {            if (admin != null) {                admin.copyTo(arg[0]);            } else {                Debug.error("DTEDAdmin:  frame parameters not set for copy.  Need source directory");                System.exit(0);            }        }        arg = ap.getArgValues("query");        if (arg != null) {            if (admin != null) {                Debug.output("DTED frame files found:");                admin.query();            } else {                Debug.error("DTEDAdmin:  frame parameters not set for query.  Need source directory");                System.exit(0);            }        }        arg = ap.getArgValues("remove");        if (arg != null) {            if (admin != null) {                Debug.output("These files will be deleted:");                admin.query();                Debug.output("Are you sure you want to delete them? [y/N]");                int answer= 'n';                try {                    answer = System.in.read();                } catch (IOException ioe) {                }                if (answer == 'Y' || answer == 'y') {                    admin.remove();                } else {                    Debug.output("File removal aborted.");                }            } else {                Debug.error("DTEDAdmin:  frame parameters not set for copy.  Need source directory");                System.exit(0);            }                    }    }