public static void main(String[] args) {
        if(args.length == 0) {
            args = new String[2];
            args[0] = "-f";
            args[1] = "/home/xavi/Dropbox/universitat/IMPACT/xavi-isabel/RuyLopez/XMLsNoBin/RuyLopez-0010.xml";
        }
        String key, value;
        CmdOptionTester optionTester = new CmdOptionTester();
        CmdOptions parser = new CmdOptions();
        boolean debug = false;


        Option ofile = parser.addStringOption('f', "files");
        Option odir = parser.addStringOption('d', "dir");

        try {
            parser.parse(args);
        } catch (IllegalOptionValueException ex) {
            Logger.getLogger(ReplaceGTChars.class.getName()).log(Level.SEVERE, null, ex);
        } catch (UnknownOptionException ex) {
            Logger.getLogger(ReplaceGTChars.class.getName()).log(Level.SEVERE, null, ex);
        }

        String f = optionTester.testFile(parser, ofile);
        SimplifyGT simplifier;
        if (f != null) {
            simplifier = new SimplifyGT();
            simplifier.load(f);
            simplifier.save(null);
        } else {
            String d = optionTester.testDirectory(parser, odir);
            if (d != null) {
                File dir = new File(d);
                FileListFilter select = new FileListFilter("", "xml");
                File[] files = dir.listFiles(select);

                for (File fi : files) {
                    simplifier = new SimplifyGT();
                    simplifier.load(fi.toString());
                    String out = fi.toString().replace(".xml", ".1.xml");
                    try {
                        simplifier.save(new FileWriter(out));
                    } catch (IOException ex) {
                        Logger.getLogger(SimplifyGT.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }

            }
        }

    }