async process()

in lib/cli.js [124:144]


  async process(argv) {
    // auto completion
    if (process.env.COMP_LINE) {
      await this.completion(process.env.COMP_LINE.split(' ').slice(1));
      return;
    }

    const [subcommand] = argv;
    if (this.commands.has(subcommand)) {
      await this.runCommand(subcommand, argv.slice(1));
      return;
    }

    if (subcommand) {
      console.log(`invalid sub-command '${subcommand}'`);
      await this.runCommand('help', []);
      process.exit(-1);
    }

    await this.runCommand('help', argv);
  }