diff options
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | distamp.ha | 8 |
2 files changed, 10 insertions, 1 deletions
@@ -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 @@ -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(); }; }; |
