docs: function SetupCLI(execName, packageJson, Commands, args) {
    assert(_.isString(execName), 'execName must be a string.');
    assert(_.isObject(packageJson), 'packageJson must be an object.');
    assert(_.isObject(Commands), 'Command collection must be an object.');
    assert(_.isObject(args), 'Arguments must be an object.');
  
    // --version or -v triggers npm version check.
    if (args.version || args.v) {
      const progName = packageJson.title || packageJson.name || process.argv[0];
      console.log(`${progName} ${ShowVersion(packageJson)}`);
      return process.exit(0);
    }
  
    // Remove 'color' flags if present.
    if ('color' in args) {
      delete args.color;
    }
  
    // The first positional (non-option) argument is the sub-command to run.
    const cmdName = _.first(args._);
    if (!cmdName) {
      console.error(GetCommandList(execName, packageJson, Commands));
      return process.exit(1);
    }
    const cmd = global.COMMAND = Commands[cmdName];
    if (!cmd) {
      console.error(col.fatal(`Unknown command "${col.bold(cmdName)}".`));
      return process.exit(1);
    }
  
    // Show command-specific help.
    if (args.help || args.h) {
      console.error(GetCommandUsage(execName, packageJson, cmd, args));
      return process.exit(1);
    }
  
    // Parse command-line parameters
    try {
      args = ParseArguments(cmd, args);
    } catch (e) {
      console.error(col.fatal(e.message));
      return process.exit(1);
    }
  
    return args;
  }