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