diff --git a/src/main.cpp b/src/main.cpp index 7143ef5..488d2ce 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -78,8 +78,10 @@ static void Run(const std::string& inputFile, const std::string& outputFile, con if (outputFile.ends_with(".svg")) Render(shapes, outputFile, width, height); - else + else if (outputFile.ends_with(".pgm")) Render(shapes, outputFile, width, height); + else + throw std::runtime_error("Unsupported output file format. Supported formats are .svg and .pgm"); std::cout << "OK" << std::endl; std::cout << file.GetNumProcessedCmds() << std::endl;