2023-10-04 17:30:00 +00:00
|
|
|
import server : startServer;
|
2023-11-05 15:18:12 +00:00
|
|
|
import report.gen : makeReport;
|
2023-10-04 17:30:00 +00:00
|
|
|
|
2023-11-05 15:18:12 +00:00
|
|
|
int main(string[] args) {
|
2023-10-05 16:35:52 +00:00
|
|
|
import slf4d;
|
|
|
|
import slf4d.default_provider;
|
|
|
|
auto provider = new shared DefaultProvider(false, Levels.INFO);
|
|
|
|
provider.getLoggerFactory().setModuleLevelPrefix("handy_httpd", Levels.WARN);
|
|
|
|
// provider.getLoggerFactory().setModuleLevel("live_tracker", Levels.DEBUG);
|
|
|
|
configureLoggingProvider(provider);
|
|
|
|
|
2023-10-04 17:30:00 +00:00
|
|
|
if (args.length <= 1) {
|
|
|
|
startServer();
|
2023-11-05 15:18:12 +00:00
|
|
|
return 0;
|
2023-10-04 17:30:00 +00:00
|
|
|
} else if (args[1] == "report") {
|
2023-11-05 15:18:12 +00:00
|
|
|
return makeReport(args[2..$]);
|
|
|
|
} else {
|
|
|
|
import std.stdio;
|
|
|
|
writeln("Invalid command. Expected no-args to start server, or \"report\" for report generation.");
|
|
|
|
return 1;
|
2023-10-03 19:51:30 +00:00
|
|
|
}
|
|
|
|
}
|