diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-11-04 02:19:09 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-11-04 02:19:09 -0500 |
commit | 76bc3b3677062c0c1a6b9fa08ff20d12e470159c (patch) | |
tree | 390897784acdec4f002df4a13e5d63f1f641fb40 /main.cpp | |
parent | 5a65625cb589b2cb5b336e1fa5748df8dcdb8f6a (diff) | |
download | wizard-76bc3b3677062c0c1a6b9fa08ff20d12e470159c.tar.gz wizard-76bc3b3677062c0c1a6b9fa08ff20d12e470159c.tar.bz2 wizard-76bc3b3677062c0c1a6b9fa08ff20d12e470159c.zip |
Some old refactoring + some new refactoring
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..a0ba7bb --- /dev/null +++ b/main.cpp | |||
@@ -0,0 +1,46 @@ | |||
1 | #include <Magick++.h> | ||
2 | #include <tclap/CmdLine.h> | ||
3 | |||
4 | #include <iostream> | ||
5 | #include <string> | ||
6 | |||
7 | #include "wizard.h" | ||
8 | |||
9 | int main(int argc, char** argv) { | ||
10 | Magick::InitializeMagick(nullptr); | ||
11 | |||
12 | std::random_device randomDevice; | ||
13 | std::mt19937 rng(5); // randomDevice()); | ||
14 | |||
15 | try { | ||
16 | TCLAP::CmdLine cmd("Spelling things with MTG cards", ' ', "1.0"); | ||
17 | |||
18 | TCLAP::ValueArg<std::string> cardsPath("c", "cards", | ||
19 | "Path to the card definitions file", | ||
20 | true, "", "filename"); | ||
21 | cmd.add(cardsPath); | ||
22 | |||
23 | TCLAP::ValueArg<std::string> cachePath( | ||
24 | "i", "image-cache", "Path to store cached card image downloads", true, | ||
25 | "", "filename"); | ||
26 | cmd.add(cachePath); | ||
27 | |||
28 | TCLAP::ValueArg<std::string> outputPath( | ||
29 | "o", "output", "Path to write image output to", true, "", "filename"); | ||
30 | cmd.add(outputPath); | ||
31 | |||
32 | TCLAP::ValueArg<std::string> jsonPath( | ||
33 | "j", "json", "Path to write JSON output to", false, "", "filename"); | ||
34 | cmd.add(jsonPath); | ||
35 | |||
36 | cmd.parse(argc, argv); | ||
37 | |||
38 | wizard app(cardsPath.getValue(), cachePath.getValue(), | ||
39 | outputPath.getValue(), jsonPath.getValue(), rng); | ||
40 | |||
41 | app.run(); | ||
42 | } catch (const TCLAP::ArgException& e) { | ||
43 | std::cerr << "Error: " << e.error() << " for arg " << e.argId() | ||
44 | << std::endl; | ||
45 | } | ||
46 | } | ||