Skip to content

Commit

Permalink
print stages in valhalla_build_tiles --help (#4611)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsnolde committed Mar 4, 2024
1 parent 3794239 commit 482bcf2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/argparse_utils.h
Expand Up @@ -21,6 +21,7 @@
* @param config The config which will be populated here
* @param log The logging config node's key. If empty, logging will not be configured.
* @param use_threads Whether this program multi-threads
* @param extra_help Optional function pointer to print more stuff to the end of the help message.
*
* @returns true if the program should continue, false if we should EXIT_SUCCESS
* @throws cxxopts::exceptions::exception Thrown if there's no valid configuration
Expand All @@ -30,9 +31,13 @@ bool parse_common_args(const std::string& program,
const cxxopts::ParseResult& result,
boost::property_tree::ptree& conf,
const std::string& log,
const bool use_threads = false) {
const bool use_threads = false,
std::function<void()> extra_help = nullptr) {
if (result.count("help")) {
std::cout << opts.help() << "\n";
if (extra_help) {
extra_help();
};
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/mjolnir/valhalla_build_tiles.cc
Expand Up @@ -57,7 +57,7 @@ int main(int argc, char** argv) {
options.parse_positional({"input_files"});
options.positional_help("OSM PBF file(s)");
auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, config, "mjolnir.logging", true))
if (!parse_common_args(program, options, result, config, "mjolnir.logging", true, &list_stages))
return EXIT_SUCCESS;

// Convert stage strings to BuildStage
Expand Down

0 comments on commit 482bcf2

Please sign in to comment.