default the output file name
This commit is contained in:
1 parent
68d5b39cfd
commit
d7394027b1
1 file changed
+14
@@ -7,5 +7,19 @@ Engine::Engine(const RenderParams & params)
|
||||
|
||||
int Engine::run(string_view input_file, opt<string_view> output_file)
|
||||
{
|
||||
string output_path;
|
||||
if (output_file)
|
||||
{
|
||||
output_path = *output_file;
|
||||
}
|
||||
else
|
||||
{
|
||||
string_view base = input_file;
|
||||
if (base.ends_with(".fart"))
|
||||
{
|
||||
base.remove_suffix(5u);
|
||||
}
|
||||
output_path = string(base) + ".png";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user