Each vibescrobble command's flags are now declared once (#90). COMMANDS in main.rs lists every command with its flags and how each takes its value: one value, an optional value (--repo [<url>]), or none. check_flags reads that table. So do flag and has, which now take the command and, in debug builds, refuse a name it doesn't declare. Before, check_flags was a separate hand-written table that had to agree with lookups spread through each command, and a flag added to one but not the other was refused or ignored without a word. The hand-written usage text, error messages and exit codes are unchanged. Clap was considered, but it would have meant rewriting all three.
The one behaviour change is that doctor now accepts --repo, --no-repo and --no-usage. Its checks already read them, so this fixes the same bug, which the new test caught. The usage text for doctor doesn't list them yet.
every_flag_lookup_names_a_declared_flag scans the CLI's source for every flag(…)/has(…) lookup and fails if its command doesn't declare that flag. It fails when --wait is renamed to an undeclared --waits. All 165 CLI tests pass, as do the plugin tests, which parse CLI commands.
🤖 Generated with Claude Code