From e80a5c552c38275cdadafb1ac9a86a230aea8e64 Mon Sep 17 00:00:00 2001 From: MESYETI Date: Tue, 2 Apr 2024 19:15:01 +0100 Subject: [PATCH] remove debug prints and add version --- source/app.d | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/app.d b/source/app.d index 4ec4808..c86f6e6 100644 --- a/source/app.d +++ b/source/app.d @@ -21,6 +21,7 @@ Flags: -O - Enables optimisation (only works properly with programs without errors) -v VER - Enables VER as a version -b BACKEND - Uses the given backend (backends listed below) + --version - Shows the callisto version Backends: rm86 - Real mode x86 @@ -45,8 +46,6 @@ int main(string[] args) { string[] versions; CompilerBackend backend = new BackendRM86(); - writeln(backend.GetVersions()); - for (size_t i = 1; i < args.length; ++ i) { if (args[i][0] == '-') { switch (args[i]) { @@ -106,7 +105,7 @@ int main(string[] args) { } versions ~= args[i]; - break; + return 0; } case "-b": { ++ i; @@ -129,6 +128,10 @@ int main(string[] args) { } break; } + case "--version": { + writeln("Callisto compiler beta 0.1"); + break; + } default: { stderr.writefln("Unknown flag '%s'", args[i]); return 1; @@ -145,8 +148,6 @@ int main(string[] args) { } } - writeln(backend.GetVersions()); - if (file == "") { stderr.writeln("No source files"); return 1; @@ -161,8 +162,6 @@ int main(string[] args) { compiler.backend.orgSet = orgSet; versions ~= compiler.backend.GetVersions(); - - writeln(backend.GetVersions()); auto preproc = new Preprocessor(); preproc.includeDirs = includeDirs;