code: function(obj) {
      // Parse cmdargs
      var subcommand = this._processCmdargs(obj)
  
      // Environment variables (allow a sub-command to explicitly opt-out of environment variable processing)
      if (_.isUndefined(subcommand) ||
        (_.isUndefined(obj.cmdargs[subcommand].processEnvironmentVariables) ||
        obj.cmdargs[subcommand].processEnvironmentVariables)) {
        this._processEnvironmentVariables(obj)
      }
  
      // Do it
      var exitVal = 0
      if (typeof obj._main === 'object') {
        // if obj._main is an object then dispatch based on subcommand
        if (typeof subcommand === 'undefined' && 'default' in obj._main) {
          subcommand = 'default'
        }
        // bind the handler to the top level object and call it
        var handler = obj._main[subcommand].bind(obj)
        exitVal = handler(obj.parsedCmdargs)
      } else {
        exitVal = obj._main(obj.parsedCmdargs)
      }
  
      if (exitVal === undefined) {
        exitVal = 0
      } else if (typeof(exitVal) !== 'number') {
        exitVal = 128
        console.log("WARN: Recieved non-numeric exit code: " + exitVal + ". Returning 128.")
      }
  
  //    process.exit(exitVal)
    }
docs: ***************************************************************************
  @method _invokeMain
  @description Invokes the "main" method of "obj". Note, this may involve calling
  the appropriate sub-command handler if ``obj._main`` is an object and
  not simply a function.
  @todo clean up exit code handling
  @ignore