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
6
#include "
porytiles/build_version.h
"
7
8
#include "
command_compile_tileset.hpp
"
9
#include "
command_completion.hpp
"
10
#include "
command_create_tileset.hpp
"
11
#include "
command_decompile_tileset.hpp
"
12
#include "
command_dump_attribute_schema.hpp
"
13
#include "
command_dump_tileset_config.hpp
"
14
#include "
command_import_tileset.hpp
"
15
#include "
command_list_tilesets.hpp
"
16
#include "
custom_formatter.hpp
"
17
18
int
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 {} {}
28
grunt-lucas <grunt.lucas@yahoo.com>
29
30
Overworld tileset compiler for use with the pokeruby, pokefirered, and
31
pokeemerald Pokémon Generation III decompilation projects from pret. Also
32
compatible with pokeemerald-expansion from rh-hideout. Builds Porymap-ready
33
assets from RGBA (or indexed) input assets.
34
35
Home 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
42
USER DOCUMENTATION
43
https://grunt-lucas.github.io/porytiles-user-docs
44
45
DEVELOPER DOCUMENTATION
46
https://grunt-lucas.github.io/porytiles-dev-docs
47
48
DOXYGEN SOURCE CODE DOCUMENTATION
49
https://grunt-lucas.github.io/porytiles
50
51
COMMUNITY-MADE TUTORIAL VIDEOS
52
https://www.youtube.com/playlist?list=PLuyjFojPxF7-O5o_mS6uTBtyYcuyFf_Ce
53
54
SEE ALSO
55
https://github.com/pret/pokeruby
56
https://github.com/pret/pokefirered
57
https://github.com/pret/pokeemerald
58
https://github.com/rh-hideout/pokeemerald-expansion
59
https://github.com/huderlem/porymap)");
60
61
// Override some --version,--help flag defaults.
62
porytiles_app.add_flag(
63
"-V,--version"
,
64
[](
const
size_t
) {
65
std::cout <<
PORYTILES_EXECUTABLE
<<
" "
<<
PORYTILES_BUILD_VERSION
<<
" "
<<
PORYTILES_BUILD_DATE
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
}
build_version.h
PORYTILES_EXECUTABLE
#define PORYTILES_EXECUTABLE
Definition
build_version.h:25
PORYTILES_BUILD_VERSION
#define PORYTILES_BUILD_VERSION
Definition
build_version.h:26
PORYTILES_BUILD_DATE
#define PORYTILES_BUILD_DATE
Definition
build_version.h:27
CompileTilesetCommand
Definition
command_compile_tileset.hpp:18
CompletionCommand
Command that outputs shell completion scripts.
Definition
command_completion.hpp:25
CreateTilesetCommand
Definition
command_create_tileset.hpp:18
DecompileTilesetCommand
Definition
command_decompile_tileset.hpp:18
DumpAttributeSchemaCommand
Definition
command_dump_attribute_schema.hpp:21
DumpTilesetConfigCommand
Definition
command_dump_tileset_config.hpp:18
ImportTilesetCommand
Definition
command_import_tileset.hpp:19
ListTilesetsCommand
Lists tileset names in the project.
Definition
command_list_tilesets.hpp:28
command_compile_tileset.hpp
command_completion.hpp
command_create_tileset.hpp
command_decompile_tileset.hpp
command_dump_attribute_schema.hpp
command_dump_tileset_config.hpp
command_import_tileset.hpp
command_list_tilesets.hpp
custom_formatter.hpp
main
int main(const int argc, char **argv)
Definition
main.cpp:18
porytiles
tools
driver
main.cpp
Generated by
1.9.8