Added clean command.

This commit is contained in:
Andrew Lalis 2022-12-09 11:44:27 +01:00
parent 1a442c4b9d
commit 8f67837925
1 changed files with 13 additions and 1 deletions

14
build.d
View File

@ -24,7 +24,19 @@ const string[] COMPILER_FLAGS = [
];
int main(string[] args) {
build();
if (args.length < 2) {
return build();
}
string command = args[1].strip.toLower;
if (command == "build") return build();
if (command == "clean") return clean();
writefln!"Unknown command: \"%s\"."(command);
return 0;
}
int clean() {
rmdirRecurse(BUILD_DIR);
return 0;
}