2022-06-11 00:38:03 +02:00
|
|
|
import elna.backend;
|
2022-06-05 15:16:04 +02:00
|
|
|
import elna.ir;
|
2022-06-08 08:34:44 +02:00
|
|
|
import elna.arguments;
|
2022-06-11 00:38:03 +02:00
|
|
|
import std.path;
|
2022-06-06 22:56:28 +02:00
|
|
|
import std.sumtype;
|
2022-06-05 15:16:04 +02:00
|
|
|
import tanya.container.string;
|
|
|
|
import tanya.memory.allocator;
|
|
|
|
import tanya.memory.mmappool;
|
|
|
|
|
|
|
|
int main(string[] args)
|
|
|
|
{
|
|
|
|
defaultAllocator = MmapPool.instance;
|
|
|
|
|
2022-06-08 08:34:44 +02:00
|
|
|
return Arguments.parse(args).match!(
|
|
|
|
(ArgumentError argumentError) => 4,
|
|
|
|
(Arguments arguments) {
|
|
|
|
String outputFilename;
|
|
|
|
if (arguments.output is null)
|
|
|
|
{
|
2022-06-11 00:38:03 +02:00
|
|
|
outputFilename = arguments
|
|
|
|
.inFile
|
|
|
|
.baseName
|
|
|
|
.withExtension("o");
|
2022-06-08 08:34:44 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
outputFilename = String(arguments.output);
|
|
|
|
}
|
2022-06-05 15:16:04 +02:00
|
|
|
|
2022-06-11 00:38:03 +02:00
|
|
|
return generate(arguments.inFile, outputFilename);
|
2022-06-08 08:34:44 +02:00
|
|
|
}
|
|
|
|
);
|
2022-06-05 15:16:04 +02:00
|
|
|
}
|