From f318426a1dd1d44094989200057b80e8c318abd4 Mon Sep 17 00:00:00 2001 From: lost+skunk Date: Mon, 9 Sep 2024 11:14:58 +0000 Subject: [PATCH] Update main.d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit так более лаконично --- main.d | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/main.d b/main.d index dc8041d..2277e08 100644 --- a/main.d +++ b/main.d @@ -1,14 +1,13 @@ -import std.stdio, std.json, std.getopt; +import std.stdio, std.json; import std.net.curl, std.conv: to; import core.stdc.stdlib: exit; -void main(string[] args) { - string serverName; - try getopt(args, config.required, "server|s", "Matrix server domain", &serverName); - catch (GetOptException e) { - writeln(e.msg); +void main(string[] arg) { + if (arg.length < 2) { + writefln("Missing server name. Specify it by following example: '%s ebloid.ru'", arg[0]); exit(1); } + string serverName = arg[1]; CHECK: serverName = "https://"~serverName;