ESRIRecord r;
    public static void main(String args[]) throws IOException {        Debug.init(System.getProperties());        int argc = args.length;        if (argc == 1) {            ShapeFile sf = new ShapeFile(args[0]);            Debug.output("Shape file: " + args[0]);            Debug.output("version: " + sf.getFileVersion());            Debug.output("length: " + sf.getFileLength());            Debug.output("bounds:");            Debug.output("\tmin: " + sf.getBoundingBox().min);            Debug.output("\tmax: " + sf.getBoundingBox().max);            ESRIRecord r;            int nRecords = 0;            while ((r = sf.getNextRecord()) != null) {                nRecords++;            }            Debug.output("records: " + nRecords);        } else if ("-a".equals(args[0])) {            // Append a shape file to another shape file            String destFile = args[1];            String srcFile = args[2];            ShapeFile in = new ShapeFile(srcFile);            ShapeFile out = new ShapeFile(destFile);            if (in.getShapeType() != out.getShapeType()) {                try {                    out.setShapeType(in.getShapeType());                } catch (IllegalArgumentException e) {                    Debug.error("Incompatible shape types.");                    System.exit(1);                }            }            ESRIRecord r;            while ((r = in.getNextRecord()) != null) {                out.add(r);            }            out.verify(true, true);        } else if ("-v".equals(args[0])) {            // Verify a shape file            String shpFile = args[1];            ShapeFile s = new ShapeFile(shpFile);            s.verify(true, true);        } else {            Debug.output("Usage:");            Debug.output("ShapeFile file.shp  -- displays information about file.shp");            Debug.output("ShapeFile -a dest.shp src.shp  -- appends records from src.shp to dest.shp");            Debug.output("ShapeFile -v file.shp  -- verifies file.shp");        }    }