flarum/framework · warning
No option chosen. Run with --help for the list of options.
Error message
No option chosen. Run with --help for the list of options.
What it means
ClearLogsCommand requires one of --before (with confirm), --force, or --reset; if none of the code paths matched, it warns that no option was chosen and points at --help. It signals an invocation without an actionable mode.
Solutions
- Run `php flarum clear:logs --help` to list valid options
- Add --before=<date> to prune by date
- Add --reset for full wipe/disable, optionally with --force
Example fix
// before php flarum clear:logs // after php flarum clear:logs --before=2026-01-01
Defensive patterns
Strategy: validation
Validate before calling
$opts = ['--before', '--reset', '--force'];
if (empty(array_intersect($opts, $argv))) { exit("Run with --help for options\n"); } Prevention
- Always include an explicit mode flag when scripting clear:logs
- Run --help once per version — flags may change
- Wrap the command in a helper that enforces a mode
When it happens
Trigger: Running `php flarum clear:logs` with no flags, or flags that fail to match any handled branch in handle().
Common situations: Forgotten flag, typo in --before/--reset/--force, or invoking the command to 'see what it does'.
Understand the failure class
Background: "Must pass :limit option" / "Missing required option" — required option errors explained — this error's family across 41 libraries.
Related errors
AI-assisted analysis of flarum/framework@4b939f6853 (2026-09-15).
Data as JSON: /api/errors/1c762f9b18f9692a.
Report an issue: GitHub.
Appendix: source
Thrown at extensions/audit/src/Console/ClearLogsCommand.php:80
AuditLogger::$disabled = true;
$db->getSchemaBuilder()->dropIfExists('audit_log');
$this->info('Table deleted.');
// Delete the migration entries to ensure they will run again next time the extension is re-enabled
$db->table('migrations')->where('extension', 'flarum-audit')->delete();
$this->info('Migration entries deleted.');
$manager->disable('flarum-audit');
$this->info('Extension disabled.');
$this->info('All done!');
return;
}
$this->warn('No option chosen. Run with --help for the list of options.');
}
}
View on GitHub (pinned to 4b939f6853)