docs: function _postCommand(args, commandsConfig, globalOptsConfig) {
  
    function _validate(value, name, desc) {
      return function (rule) {
        if (iz.hasOwnProperty(rule)) {
          var isValid = iz[rule](value);
          if (isValid === null || isValid === false) {
            exit(new Error(util.format('Invalid %s: <%s> must be %s', desc, name, rule)));
          }
        } else {
          exit(new Error(util.format('Invalid %s rule: %s', desc, rule)));
        }
      };
    }
  
    if (!args) {
      return;
  
    } else if (args.length === 0) {
      // 2 -> 'node' and 'somecommand'
      // which means that the command is executed without args, hence display help menu
      // NOTE: this check is needed because for some reason commander.args
      // also returns empty array when one of the args is an opt (-- prefixed)
      if (process.argv.length === 2) {
        commander.help();
      }
  
    } else {
      var lastArg = args[args.length - 1],
        commandName = lastArg._name,
        commandArgs = (commandsConfig[commandName]) ? commandsConfig[commandName].args : undefined,
        commandOpts = (commandsConfig[commandName]) ? commandsConfig[commandName].options : undefined;
  
      // non-object last arg means command is not configured in setup
      if (typeof lastArg !== 'object') {
        exit(new Error(util.format('Unknown command: %s, use --help for more info', lastArg)));
  
      } else if (commandArgs && commandArgs.length > 0) {
        var programName = lastArg.parent._name;
  
        // display usage info when expected arguments don't exist
        if (args.length === 1) {
          exit(new Error(util.format('Usage: %s %s %s', programName, commandName, commandArgs.map(function (arg) {
            return util.format((arg.optional) ? '[%s]' : '<%s>', arg.name);
          }).join(' '))));
        } else {
          // validate arguments as configured in commands setup
          for (var i = 0, ln = commandArgs.length; i < ln; i += 1) {
            if (!commandArgs[i].optional) {
              commandArgs[i].rules.forEach(_validate(args[i], commandArgs[i].name, 'argument'));
            }
          }
        }
      }
  
      // validate command opts as configured in commands setup
      if (commandOpts) {
        commandOpts.forEach(function (commandOpt) {
          if (commandOpt.rules) {
            var name = commandOpt.arg,
              value = lastArg[name.match(/<.*>/)[0].replace(/[<>]/g, '')];
            commandOpt.rules.forEach(_validate(value, name, 'option'));
          }
        });
      }
  
      // validate global opts as configured in commands setup
      if (globalOptsConfig) {
        globalOptsConfig.forEach(function (globalOptConfig) {
          if (globalOptConfig.rules) {
            var name = globalOptConfig.arg,
              value = lastArg.parent[name.match(/<.*>/)[0].replace(/[<>]/g, '')];
            globalOptConfig.rules.forEach(_validate(value, name, 'option'));
          }
        });
      }
    }
  }