Porytiles
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1#include <format>
2#include <memory>
3
4#include "CLI/CLI.hpp"
5
7
15#include "custom_formatter.hpp"
16
17int main(const int argc, char **argv)
18{
19 CLI::App porytiles_app{"Porytiles"};
20
21 // Set custom formatter for cleaner help output (inherited by subcommands)
22 porytiles_app.formatter(std::make_shared<porytiles::PorytilesFormatter>());
23
24 porytiles_app.description(
25 std::format(
26 R"(porytiles {} {}
27grunt-lucas <grunt.lucas@yahoo.com>
28
29Overworld tileset compiler for use with the pokeruby, pokefirered, and
30pokeemerald Pokémon Generation III decompilation projects from pret. Also
31compatible with pokeemerald-expansion from rh-hideout. Builds Porymap-ready
32assets from RGBA (or indexed) input assets.
33
34Home Page: https://github.com/grunt-lucas/porytiles)",
35 std::string{PORYTILES_BUILD_VERSION},
36 std::string{PORYTILES_BUILD_DATE}));
37
38 porytiles_app.footer(
39 R"(To get more help with Porytiles, check out the following guides:
40
41USER DOCUMENTATION
42https://grunt-lucas.github.io/porytiles-user-docs
43
44DEVELOPER DOCUMENTATION
45https://grunt-lucas.github.io/porytiles-dev-docs
46
47DOXYGEN SOURCE CODE DOCUMENTATION
48https://grunt-lucas.github.io/porytiles
49
50COMMUNITY-MADE TUTORIAL VIDEOS
51https://www.youtube.com/playlist?list=PLuyjFojPxF7-O5o_mS6uTBtyYcuyFf_Ce
52
53SEE ALSO
54https://github.com/pret/pokeruby
55https://github.com/pret/pokefirered
56https://github.com/pret/pokeemerald
57https://github.com/rh-hideout/pokeemerald-expansion
58https://github.com/huderlem/porymap)");
59
60 // Override some --version,--help flag defaults.
61 porytiles_app.add_flag(
62 "-V,--version",
63 [](const size_t) {
65 << std::endl;
66 std::exit(0);
67 },
68 "Print version info and exit.");
69 porytiles_app.get_option("--help")->description("Print this help message and exit.");
70
71 CreateTilesetCommand create_tileset{porytiles_app};
72 ImportTilesetCommand import_tileset{porytiles_app};
73 CompileTilesetCommand compile_tileset{porytiles_app};
74 DecompileTilesetCommand decompile_tileset{porytiles_app};
75 DumpTilesetConfigCommand dump_tileset_config{porytiles_app};
76 CompletionCommand completion{porytiles_app};
77 ListTilesetsCommand list_tilesets{porytiles_app};
78
79 porytiles_app.require_subcommand();
80
81 CLI11_PARSE(porytiles_app, argc, argv);
82 return 0;
83}
#define PORYTILES_EXECUTABLE
#define PORYTILES_BUILD_VERSION
#define PORYTILES_BUILD_DATE
Command that outputs shell completion scripts.
Lists tileset names in the project.
int main(const int argc, char **argv)
Definition main.cpp:17