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