Update main.d

так более лаконично
This commit is contained in:
lost+skunk 2024-09-09 11:14:58 +00:00
parent 55328e0f0f
commit f318426a1d

11
main.d
View File

@ -1,14 +1,13 @@
import std.stdio, std.json, std.getopt; import std.stdio, std.json;
import std.net.curl, std.conv: to; import std.net.curl, std.conv: to;
import core.stdc.stdlib: exit; import core.stdc.stdlib: exit;
void main(string[] args) { void main(string[] arg) {
string serverName; if (arg.length < 2) {
try getopt(args, config.required, "server|s", "Matrix server domain", &serverName); writefln("Missing server name. Specify it by following example: '%s ebloid.ru'", arg[0]);
catch (GetOptException e) {
writeln(e.msg);
exit(1); exit(1);
} }
string serverName = arg[1];
CHECK: CHECK:
serverName = "https://"~serverName; serverName = "https://"~serverName;