void addCmdLine()

in src/main/cpp/ide/cmdargs.h [59:102]


    void addCmdLine(const char *cmdLine) {
        char arg[1024] = "";
        bool inQuotes = false;
        bool inText = false;
        int i = 0;
        int j = 0;
        char c;
        while (c = cmdLine[i]) {
            if (inQuotes) {
                if (c == '\"') {
                    inQuotes = false;
                } else {
                    arg[j++] = c;
                }
            } else {
                switch (c) {
                    case '\"':
                        inQuotes = true;
                        inText = true;
                        break;
                    case ' ':
                    case '\t':
                    case '\n':
                    case '\r':
                        if (inText) {
                            arg[j] = '\0';
                            add(arg);
                            j = 0;
                        }
                        inText = false;
                        break;
                    default:
                        inText = true;
                        arg[j++] = c;
                        break;
                }
            }
            i++;
        }
        if (j > 0) {
            arg[j] = '\0';
            add(arg);
        }
    }