From 77b1c36aab701f10f5ea7a655eae0bfb362b12c5 Mon Sep 17 00:00:00 2001 From: tovjemam Date: Fri, 5 Dec 2025 14:46:56 +0100 Subject: [PATCH] Fix unsupported format --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;