phacility/phabricator · error · PhutilArgumentUsageException
Specify either specific users with
Error message
Specify either specific users with %s, or all users with %s, but not both.
What it means
Usage guard in `bin/auth strip`: both specific --user arguments and the --all-users flag were given. These target selections are mutually exclusive, so execute() refuses to proceed until one mode is chosen.
Solutions
- Drop --all-users and keep --user <username>, or vice versa
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php:61 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/74781f2bbd43f8b6.
Report an issue: GitHub.
Appendix: source
Thrown at src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php:61
array(
'name' => 'force',
'help' => pht('Strip factors without prompting.'),
),
array(
'name' => 'dry-run',
'help' => pht('Show factors, but do not strip them.'),
),
));
}
public function execute(PhutilArgumentParser $args) {
$viewer = $this->getViewer();
$usernames = $args->getArg('user');
$all_users = $args->getArg('all-users');
if ($usernames && $all_users) {
throw new PhutilArgumentUsageException(
pht(
'Specify either specific users with %s, or all users with '.
'%s, but not both.',
'--user',
'--all-users'));
} else if (!$usernames && !$all_users) {
throw new PhutilArgumentUsageException(
pht(
'Use "--user <username>" to specify which user to strip factors '.
'from, or "--all-users" to strip factors from all users.'));
} else if ($usernames) {
$users = id(new PhabricatorPeopleQuery())
->setViewer($this->getViewer())
->withUsernames($usernames)
->execute();
$users_by_username = mpull($users, null, 'getUsername');
foreach ($usernames as $username) {View on GitHub (pinned to 5720a38cfe)