code: function validateRequired(config, commandSpec) {
    var errors = '';
    
    if (commandSpec.parameters) {
      commandSpec.parameters.forEach(function(param) {
        if (param.required == true
        && (config[param.name] == '' || config[param.name] == []) ) {
          errors += 'Parameter ' + param.name + ' is required\n';
        }
      })
    }
    
    if (commandSpec.options) {
      for (var i=0;i<commandSpec.options.length;i++) {
        if (commandSpec.options[i].required
        && commandSpec.options[i].required == true
        && config.options[commandSpec.options[i].option] == '') {
          errors += 'Option ' + commandSpec.options[i].option + ' is required\n';
        }
      }
    }
    
    if (commandSpec.environment) {
      for (var i=0;i<commandSpec.environment.length;i++) {
        if (commandSpec.environment[i].required
        && commandSpec.environment[i].required == true
        && config.environment[commandSpec.environment[i].parameter] == '') {
          errors += 'Environment ' + commandSpec.environment[i].parameter + ' is required\n';
        }      
      }
    }
    
    if (errors != '') errors = errors.substring(0, errors.length-1);   //remove trailing newline
    return errors;
  }
docs: /* Validate required options, parameters, environment