public static Command processTags(String[] args, Command.Commands type) {
        String outFile = args[args.length - 1];
        String inFile = outFile;
        if (args.length % 2 == 1 ) {
            inFile = args[args.length - 2];
        }

        System.out.println("Source file: " + inFile);
        System.out.println("Output file: " + outFile);

        List<String> tags = new ArrayList<String>();
        for (int i=1; i<args.length-2; i += 2) {
            if (! "-t".equals(args[i]) || ! args[i+1].contains("=")) {
                throw new IllegalArgumentException(
                        "Expecting '-t name=value' but found '" +
                                args[i] + " " + args[i+1] + "'"
                );
            }
            tags.add(args[i+1]);
        }
        
        return new Command(inFile, outFile, tags, type);
    }