From 76bc3b3677062c0c1a6b9fa08ff20d12e470159c Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 4 Nov 2024 02:19:09 -0500 Subject: Some old refactoring + some new refactoring --- main.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..a0ba7bb --- /dev/null +++ b/main.cpp @@ -0,0 +1,46 @@ +#include +#include + +#include +#include + +#include "wizard.h" + +int main(int argc, char** argv) { + Magick::InitializeMagick(nullptr); + + std::random_device randomDevice; + std::mt19937 rng(5); // randomDevice()); + + try { + TCLAP::CmdLine cmd("Spelling things with MTG cards", ' ', "1.0"); + + TCLAP::ValueArg cardsPath("c", "cards", + "Path to the card definitions file", + true, "", "filename"); + cmd.add(cardsPath); + + TCLAP::ValueArg cachePath( + "i", "image-cache", "Path to store cached card image downloads", true, + "", "filename"); + cmd.add(cachePath); + + TCLAP::ValueArg outputPath( + "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); + + cmd.parse(argc, argv); + + wizard app(cardsPath.getValue(), cachePath.getValue(), + outputPath.getValue(), jsonPath.getValue(), rng); + + app.run(); + } catch (const TCLAP::ArgException& e) { + std::cerr << "Error: " << e.error() << " for arg " << e.argId() + << std::endl; + } +} -- cgit 1.4.1