docs: function processTask(app) {
  
    // Search for a task with the app name.
    var appResult = (function() {
      if (!app) {
        return null;
      } else if (argv.payload.length === 0) {
        return null;
      } else {
        var appPayload = argv.payload.slice(0);
        if (appPayload[0] !== app.name) {
          appPayload.unshift(app.name);
        }
        return kbox.tasks.find({
          payload: appPayload,
          options: argv.options,
          rawOptions: argv.rawOptions
        });
      }
    })();
  
    // Search for a task without the app name.
    var globalResult = kbox.tasks.find(argv);
  
    // For now just use the app result if it exists.
    var result = (function() {
      if (appResult) {
        return appResult;
      } else {
        return globalResult;
      }
    })();
  
    if (!result) {
  
      // We ended up with a branch, so display task tree.
      kbox.tasks.showMenu(kbox.tasks.getTaskTree(), app);
  
    } else if (kbox.tasks.isBranch(result)) {
  
      // We ended up with a branch, so display task tree.
      kbox.tasks.showMenu(result, app);
  
    } else if (kbox.tasks.isTask(result)) {
  
      // We found a task, so run it.
      kbox.tasks.run(result, function(err) {
  
        // Whoops an error happened.
        if (err) {
          handleError(err);
        }
  
      });
  
    } else {
  
      // This should never happen.
      assert(false);
  
    }
  }