code: function parseArgs(argv) {
    debug('parseArgs argv: ', argv);
  
    // default action
    var action = 'deploy';
    if ( argv['_'].length >= 1 ) {
      action = argv['_'][0];
    }
  
    failIfEmpty('e', 'environment', argv);
    failIfAbsent('e', 'environment', argv);
    if ('s' in argv || 'stacks' in argv) failIfEmpty('s', 'stacks', argv);
    return {
      environment: argv['e'] || argv['environment'],
      extraVars: parseExtraVars(argv['x'] || argv['extraVars']),
      action: action,
      region: argv['r'] || argv['region'],
      profile: argv['p'],
      cfg: argv['c'] || argv['config'],
      stackFilters: argv['s'] || argv['stacks'] || undefined
    };
  }
docs: validate command line arguments