From 1076c9b34af5b185d35ca33a14dbf0fd718ed988 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Thu, 31 Oct 2024 21:32:03 +0100 Subject: Add version flag and update README.md --- distamp.ha | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'distamp.ha') diff --git a/distamp.ha b/distamp.ha index 7de623a..19c3226 100644 --- a/distamp.ha +++ b/distamp.ha @@ -9,12 +9,17 @@ use getopt; type parseerror = !strconv::error; +def MAJOR = 2; +def MINOR = 0; +def PATCH = 0; + export fn main() void = { const cmd = getopt::parse(os::args, "discord relative timestamp generator", ('a', "date", "Absolute date (this option is exclusive, any other options will be ignored)"), ('d', "days", "Number of days"), ('w', "weeks", "Number of weeks"), + ('v', "Print version"), "m[:s]", ); defer getopt::finish(&cmd); @@ -57,6 +62,9 @@ export fn main() void = { case let e: parseerror => fmt::fatal(strerror(e)); }; + case 'v' => + fmt::printfln("{}.{}.{}-{}_{}", MAJOR, MINOR, PATCH, os::sysname(), os::arch_name(os::architecture()))!; + return; case => abort(); }; }; -- cgit v1.2.3