public static void main(String[] args) throws IOException
    {
        String sourcePath = null;
        String outputPath = null;
        for (int i = 0; i < args.length; i++) {
            if (args[i].startsWith("-") && !args[i].equals("-")) {
                switch (args[i]) {
                    case "-o":
                    case "--output":
                        i++;
                        outputPath = args[i];
                        break;
                    default:
                        throw new RuntimeException("wtf");
                }
            } else {
                if (sourcePath != null)
                    throw new RuntimeException("too many source files");
                sourcePath = args[i];
            }
        }
        if (sourcePath == null)
            throw new RuntimeException("no source files");
        if (outputPath == null)
            outputPath = "-";

        compile(sourcePath, outputPath);
    }