{"record":{"id":"1c762f9b18f9692a","repo":"flarum/framework","slug":"no-option-chosen-run-with-help-for-the-list-of-options","errorCode":null,"errorMessage":"No option chosen. Run with --help for the list of options.","messagePattern":"No option chosen\\. Run with --help for the list of options\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"extensions/audit/src/Console/ClearLogsCommand.php","lineNumber":80,"sourceCode":"\n            AuditLogger::$disabled = true;\n\n            $db->getSchemaBuilder()->dropIfExists('audit_log');\n            $this->info('Table deleted.');\n\n            // Delete the migration entries to ensure they will run again next time the extension is re-enabled\n            $db->table('migrations')->where('extension', 'flarum-audit')->delete();\n            $this->info('Migration entries deleted.');\n\n            $manager->disable('flarum-audit');\n            $this->info('Extension disabled.');\n\n            $this->info('All done!');\n\n            return;\n        }\n\n        $this->warn('No option chosen. Run with --help for the list of options.');\n    }\n}\n","sourceCodeStart":62,"sourceCodeEnd":83,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/extensions/audit/src/Console/ClearLogsCommand.php#L62-L83","documentation":"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.","triggerScenarios":"Running `php flarum clear:logs` with no flags, or flags that fail to match any handled branch in handle().","commonSituations":"Forgotten flag, typo in --before/--reset/--force, or invoking the command to 'see what it does'.","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"],"exampleFix":"// before\nphp flarum clear:logs\n// after\nphp flarum clear:logs --before=2026-01-01","handlingStrategy":"validation","validationCode":"$opts = ['--before', '--reset', '--force'];\nif (empty(array_intersect($opts, $argv))) { exit(\"Run with --help for options\\n\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["cli","missing-option","usage-error"],"backgroundTag":"missing-required-option","analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}