From 460b99583bcf6da4462f13ad75856283849904e7 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 4 Nov 2024 02:37:02 -0500 Subject: main.cpp does work for standalone entry --- main.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index a0ba7bb..9327c20 100644 --- a/main.cpp +++ b/main.cpp @@ -4,6 +4,8 @@ #include #include +#include "cardset.h" +#include "imagestore.h" #include "wizard.h" int main(int argc, char** argv) { @@ -29,16 +31,18 @@ int main(int argc, char** argv) { "o", "output", "Path to write image output to", true, "", "filename"); cmd.add(outputPath); - TCLAP::ValueArg jsonPath( - "j", "json", "Path to write JSON output to", false, "", "filename"); - cmd.add(jsonPath); + TCLAP::ValueArg textInput("t", "text", "Text to render", true, + "", "text"); + cmd.add(textInput); cmd.parse(argc, argv); - wizard app(cardsPath.getValue(), cachePath.getValue(), - outputPath.getValue(), jsonPath.getValue(), rng); + cardset cards(cardsPath.getValue()); + imagestore images(cachePath.getValue()); - app.run(); + wizard app(cards, images, textInput.getValue(), rng); + Magick::Image result = app.run(); + result.write(outputPath.getValue()); } catch (const TCLAP::ArgException& e) { std::cerr << "Error: " << e.error() << " for arg " << e.argId() << std::endl; -- cgit 1.4.1