21 static constexpr auto APP_KEY =
"app";
23 static constexpr auto ALGO_ID_FLAG_STR =
"-a";
24 static constexpr auto ALGO_ID_OPTION_STR =
"--algo";
25 static constexpr auto ALGO_ID_WORD_STR =
"algo";
27 static constexpr auto BLOCK_ID_FLAG_STR =
"-b";
28 static constexpr auto BLOCK_ID_OPTION_STR =
"--block";
29 static constexpr auto BLOCK_ID_WORD_STR =
"block";
31 static constexpr auto ROW_FLAG_STR =
"-r";
32 static constexpr auto ROW_OPTION_STR =
"--rows";
33 static constexpr auto ROW_WORD_STR =
"rows";
35 static constexpr auto COLUMN_FLAG_STR =
"-c";
36 static constexpr auto COLUMN_OPTION_STR =
"--columns";
37 static constexpr auto COLUMN_WORD_STR =
"columns";
39 static constexpr auto LEVEL_FLAG_STR =
"-l";
40 static constexpr auto LEVEL_OPTION_STR =
"--levels";
41 static constexpr auto LEVEL_WORD_STR =
"levels";
44 static constexpr auto JSON_FLAG_STR =
"-j";
45 static constexpr auto JSON_OPTION_STR =
"--json";
46 static constexpr auto JSON_WORD_STR =
"json";
49 static constexpr auto OUTPUT_ID_FLAG_STR =
"-o";
50 static constexpr auto OUTPUT_ID_OPTION_STR =
"--output";
51 static constexpr auto OUTPUT_ID_WORD_STR =
"output";
52 static constexpr auto DEFAULT_OUTPUT_FILENAME =
"maze.txt";
55 static constexpr auto OUTPUT_FILENAME_WORD_STR =
"output_filename";
58 static constexpr auto SEED_FLAG_STR =
"-s";
59 static constexpr auto SEED_OPTION_STR =
"--seed";
60 static constexpr auto SEED_WORD_STR =
"seed";
63 static constexpr auto DISTANCES_FLAG_STR =
"-d";
64 static constexpr auto DISTANCES_OPTION_STR =
"--distances";
65 static constexpr auto DISTANCES_WORD_STR =
"distances";
66 static constexpr auto DISTANCES_START_STR =
"distances_start";
67 static constexpr auto DISTANCES_END_STR =
"distances_end";
70 static constexpr auto IMAGE_WIDTH_WORD_STR =
"image_width";
71 static constexpr auto IMAGE_HEIGHT_WORD_STR =
"image_height";
72 static constexpr auto IMAGE_WIDTH_OPTION_STR =
"--image-width";
73 static constexpr auto IMAGE_HEIGHT_OPTION_STR =
"--image-height";
74 static constexpr auto IMAGE_WIDTH_FLAG_STR =
"-W";
75 static constexpr auto IMAGE_HEIGHT_FLAG_STR =
"-H";
78 static constexpr auto HELP_FLAG_STR =
"-h";
79 static constexpr auto HELP_OPTION_STR =
"--help";
80 static constexpr auto HELP_WORD_STR =
"help";
83 static constexpr auto VERSION_FLAG_STR =
"-v";
84 static constexpr auto VERSION_OPTION_STR =
"--version";
85 static constexpr auto VERSION_WORD_STR =
"version";
88 static constexpr auto MASK_FLAG_STR =
"-m";
89 static constexpr auto MASK_OPTION_STR =
"--mask";
90 static constexpr auto MASK_WORD_STR =
"mask";
93 static constexpr auto SHOW_STEPS_OPTION_STR =
"--show-steps";
94 static constexpr auto SHOW_STEPS_WORD_STR =
"show_steps";
97 static constexpr auto TRUE_VALUE =
"true";
98 static constexpr auto FALSE_VALUE =
"false";
130 bool parse(const std::vector<std::
string>& arguments,
131 bool has_program_name_as_first_arg = false) const noexcept;
137 bool parse(const std::
string& arguments,
bool has_program_name_as_first_arg = false) const noexcept;
144 bool parse(
int argc,
char** argv,
bool has_program_name_as_first_arg = false) const noexcept;
152 [[nodiscard]] std::optional<std::
string>
get(const std::
string& key) const noexcept;
156 [[nodiscard]] std::optional<std::unordered_map<std::
string, std::
string>>
get() const noexcept;
160 [[nodiscard]] std::optional<std::vector<std::unordered_map<std::
string, std::
string>>>
166 std::unique_ptr<impl> pimpl;
std::optional< std::vector< std::unordered_map< std::string, std::string > > > get_array() const noexcept
Get vector of args maps (useful for JSON parsing with array of objects)
bool parse(const std::vector< std::string > &arguments, bool has_program_name_as_first_arg=false) const noexcept
Parse program arguments from a vector of strings.