From a8823a83237291b903f85e7f8426cf5033314bbc Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 13 Mar 2025 20:55:43 +0800 Subject: Accept --config not --address --- main.ha | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/main.ha b/main.ha index 2df4db4..545e9bd 100644 --- a/main.ha +++ b/main.ha @@ -18,8 +18,8 @@ use bufio; use strings; const usage: [_]getopt::help = [ - "HTTP server", - ('a', "address", "listened address") + "Lindenii Forge Server", + ('c', "config", "path to configuration file") ]; export fn main() void = { @@ -31,14 +31,7 @@ export fn main() void = { for (let opt .. cmd.opts) { switch (opt.0) { - case 'a' => - match (dial::splitaddr(opt.1, "")) { - case let value: (str, u16) => - ip_addr = ip::parsev4(value.0)!; - port = value.1; - case dial::invalid_address => - abort("invalid address"); - }; + case 'c' => yield; // TODO: actually handle the config case => abort(); // unreachable }; }; -- cgit v1.2.3