elna/source/main.d

34 lines
810 B
D
Raw Normal View History

2022-06-11 00:38:03 +02:00
import elna.backend;
2022-06-05 15:16:04 +02:00
import elna.ir;
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;
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");
}
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-05 15:16:04 +02:00
}