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 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;