function addOpt(option, optstr, key, val, from) {
        var type = optionTypes[option.type];
        var parsedVal = type.parseArg(option, optstr, val);
        if (type.array) {
            if (!opts[key]) {
                opts[key] = [];
            }
            if (type.arrayFlatten && Array.isArray(parsedVal)) {
                for (var i = 0; i < parsedVal.length; i++) {
                    opts[key].push(parsedVal[i]);
                }
            } else {
                opts[key].push(parsedVal);
            }
        } else {
            opts[key] = parsedVal;
        }
        var item = { key: key, value: parsedVal, from: from };
        _order.push(item);
    }
Parse options from the given argv.

@param inputs {Object} Optional.
     - argv {Array} Optional. The argv to parse. Defaults to
       `process.argv`.
     - slice {Number} The index into argv at which options/args begin.
       Default is 2, as appropriate for `process.argv`.
     - env {Object} Optional. The env to use for 'env' entries in the
       option specs. Defaults to `process.env`.
@returns {Object} Parsed `opts`. It has special keys `_args` (the
     remaining args from `argv`) and `_order` (gives the order that
     options were specified).