Implement most of the spec reusing scribe & nefthera code

This commit is contained in:
Juno Takano 2025-04-09 01:59:32 -03:00
commit 612a98cfde
16 changed files with 225 additions and 25 deletions

View file

@ -0,0 +1,38 @@
open Qol
type version = { major: int; minor: int; patch: int }
type help = { short: string; long: string }
type meta = { version: version; help: help }
type output = { message: string; }
type os = Unknown | FreeBSD | Void | Alpine
type host = { os: os; name: string; }
type schema = { meta: meta; output: output; host: host; }
let seed: schema = {
meta = {
version = {
major = 0;
minor = 8;
patch = 0;
};
help = {
short = "Use 'tori help' for usage instructions";
long = "<help message>";
};
};
output = {
message = "Use command 'help' for help";
};
host = {
os = Unknown;
name = "Unknown Host";
};
}
let format_version (version: version): string =
"v" ^ str_int version.major ^
"." ^ str_int version.minor ^
"." ^ str_int version.patch