From 8f678379259531c8f5240bf83bbdf0fc577ae2a9 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Fri, 9 Dec 2022 11:44:27 +0100 Subject: [PATCH] Added clean command. --- build.d | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build.d b/build.d index 8b33536..8bc6690 100755 --- a/build.d +++ b/build.d @@ -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; }