aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--distamp.ha8
2 files changed, 10 insertions, 1 deletions
diff --git a/README.md b/README.md
index e0905e7..fe28c52 100644
--- a/README.md
+++ b/README.md
@@ -6,12 +6,13 @@ Creates discord format relative timestamps, i.e.: `<t:1725834045:R>`
./distamp: discord relative timestamp generator
- Usage: ./distamp [-h] [-a <date>] [-d <days>] [-w <weeks>] m[:s]
+ Usage: ./distamp [-hv] [-a <date>] [-d <days>] [-w <weeks>] m[:s]
-h: print this help text
-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
Where m is number of minutes from now and s is number of seconds from now
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();
};
};