fix(cli): format clean no longer deletes bin/ and build/

Every verb is a bare word that is only read as a verb while no
conflicting verb is active; after one, the same word is a glob. The
guard on `clean` checked the test and lint verbs and then itself, where
the format verb was meant. `crafter-build format clean`, which asks for
the rules matching "clean", therefore removed both trees and exited 0
without formatting anything.

The guard now names format, like the three beside it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Jorijn van der Graaf 2026-10-06 18:08:26 +02:00
commit 7530954529
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB

View file

@ -1712,7 +1712,7 @@ std::int32_t Crafter::Run(std::int32_t argc, char** argv) {
runTests = true;
} else if (!runTests && !runFormat && !runClean && arg == "lint") {
runLint = true;
} else if (!runTests && !runLint && !runClean && arg == "clean") {
} else if (!runTests && !runLint && !runFormat && arg == "clean") {
runClean = true;
} else if (!runTests && !runLint && !runClean && arg == "format") {
runFormat = true;