phacility/phabricator · error · PhutilArgumentUsageException

Specify either a list of objects to affect or "--all", but…

Error message

Specify either a list of objects to affect or "--all", but not both.

What it means

Usage guard in the audit management workflow: the caller supplied both a list of objects/commits and the --all flag. loadCommitsWithConstraints requires exactly one selection mode, so a PhutilArgumentUsageException aborts the run until the user picks either explicit targets or --all.

Solutions

  1. Remove --all and keep only the specific object names, or vice versa
  2. Re-run with exactly one of the two scope forms
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/audit/management/PhabricatorAuditManagementWorkflow.php:33 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/011a6db1175b5cef. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/audit/management/PhabricatorAuditManagementWorkflow.php:33

        'wildcard' => true,
        'help' => pht('Update named commits and repositories.'),
      ),
    );
  }

  protected function loadCommitsWithConstraints(PhutilArgumentParser $args) {
    $viewer = $this->getViewer();

    $all = $args->getArg('all');
    $names = $args->getArg('objects');

    if (!$names && !$all) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify "--all" to affect everything, or a list of specific '.
          'commits or repositories to affect.'));
    } else if ($names && $all) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify either a list of objects to affect or "--all", but not '.
          'both.'));
    }

    if ($all) {
      $objects = new LiskMigrationIterator(new PhabricatorRepository());
    } else {
      $query = id(new PhabricatorObjectQuery())
        ->setViewer($viewer)
        ->withNames($names);

      $query->execute();

      $objects = array();

      $results = $query->getNamedResults();
      foreach ($names as $name) {

View on GitHub (pinned to 5720a38cfe)