docs: function swaggerSpecValidatorCmd(args, options, callback) {
    if (!callback && typeof options === 'function') {
      callback = options;
      options = null;
    }
  
    if (!callback) {
      return new Promise((resolve, reject) => {
        swaggerSpecValidatorCmd(args, options, (err, result) => {
          if (err) { reject(err); } else { resolve(result); }
        });
      });
    }
  
    if (typeof callback !== 'function') {
      throw new TypeError('callback must be a function');
    }
  
    try {
      if (args === undefined || args === null) {
        args = [];
      } else if (typeof args !== 'object'
                 || Math.floor(args.length) !== args.length) {
        throw new TypeError('args must be Array-like');
      } else if (args.length < 2 && args.length !== 0) {
        throw new RangeError('args must have at least 2 elements');
      } else {
        args = Array.prototype.slice.call(args, 2).map(String);
      }
  
      if (options !== undefined && typeof options !== 'object') {
        throw new TypeError('options must be an object');
      }
  
      options = Object.assign(
        {
          in: process.stdin,
          out: process.stdout,
          err: process.stderr
        },
        options
      );
  
      if (!options.in || typeof options.in.on !== 'function') {
        throw new TypeError('options.in must be a stream.Readable');
      }
      if (!options.out || typeof options.out.write !== 'function') {
        throw new TypeError('options.out must be a stream.Writable');
      }
      if (!options.err || typeof options.err.write !== 'function') {
        throw new TypeError('options.err must be a stream.Writable');
      }
    } catch (err) {
      process.nextTick(() => {
        callback(err);
      });
      return undefined;
    }
  
    // Workaround for https://github.com/yargs/yargs/issues/783
    // Necessary because mocha package.json overrides .parserConfiguration()
    require.main = module;
    const yargs = new Yargs(null, null, require)
      .parserConfiguration({
        'parse-numbers': false,
        'duplicate-arguments-array': false,
        'flatten-duplicate-arrays': false
      })
      .usage('Usage: $0 [options] [swagger.yaml...]')
      .option('header', {
        alias: 'H',
        describe: 'Additional HTTP header to send',
        requiresArg: true,
        array: true,
        // Prevent array from eating non-option arguments
        nargs: 1,
        coerce: parseHeaders
      })
      .help()
      .alias('help', 'h')
      .alias('help', '?')
      .option('quiet', {
        alias: 'q',
        describe: 'Print less output',
        count: true
      })
      .option('url', {
        alias: 'u',
        describe: 'Validator URL',
        defaultDescription: swaggerSpecValidator.DEFAULT_URL,
        nargs: 1
      })
      .option('verbose', {
        alias: 'v',
        describe: 'Print more output',
        count: true
      })
      .version(`${packageJson.name} ${packageJson.version}`)
      .alias('version', 'V')
      .strict();
    parseYargs(yargs, args, (err, argOpts, output) => {
      if (err) {
        if (output) {
          options.err.write(`${output}\n`);
        } else {
          options.err.write(`${err.name}: ${err.message}\n`);
        }
        callback(null, 3);
        return;
      }
  
      if (output) {
        options.out.write(`${output}\n`);
      }
  
      if (argOpts.help || argOpts.version) {
        callback(null, 0);
        return;
      }
  
      const verbosity = argOpts.verbose - argOpts.quiet;
  
      let specPaths = argOpts._;
      if (specPaths.length === 0) {
        // Default to validating stdin
        specPaths.push('-');
        if (verbosity > 1) {
          options.out.write('Reading spec from stdin...\n');
        }
      } else if (specPaths.length > 1) {
        specPaths = [...new Set(specPaths)];
      }
  
      const validateOpts = assign({}, options);
      validateOpts.request = argOpts.url ? url.parse(argOpts.url) : {};
      validateOpts.request.headers = argOpts.header;
      validateOpts.verbosity = verbosity;
  
      validateAll(specPaths, validateOpts, callback);
    });
  
    return undefined;
  }