diff options
| author | Julian Hurst <ark@mansus.space> | 2024-10-31 21:32:03 +0100 |
|---|---|---|
| committer | Julian Hurst <ark@mansus.space> | 2024-10-31 22:38:33 +0100 |
| commit | 1076c9b34af5b185d35ca33a14dbf0fd718ed988 (patch) | |
| tree | fd6896ec5f7ddba5af1a30d5462c83b480844788 /distamp.ha | |
| parent | ea927cfc55df2317b96f867107314117037fe089 (diff) | |
| download | distamp-1076c9b34af5b185d35ca33a14dbf0fd718ed988.tar.gz | |
Add version flag and update README.md2.0.0
Diffstat (limited to 'distamp.ha')
| -rw-r--r-- | distamp.ha | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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(); }; }; |
