From 6966463cf1ebfbc55f5227e72c79e5988e42f84a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 9 Nov 2024 12:18:23 +0100 Subject: [PATCH] gdaldem: fix help message for subcommands Now: ``` $ gdaldem TPI --help Usage: gdaldem TPI [--help] [--long-usage] [--help-general] [-of ] [-compute_edges] [-b ] [-co =]... [--quiet] input_dem output_TPI_map Note: gdaldem TPI --long-usage for full help. ``` vs before: ``` $ gdaldem TPI --help Usage: TPI [--help] [--long-usage] [--help-general] [-of ] [-compute_edges] [-b ] [-co =]... [--quiet] input_dem output_TPI_map Note: TPI --long-usage for full help. ``` argparse.hpp stream fix submitted to upstream in https://github.com/p-ranav/argparse/pull/382 --- apps/argparse/argparse.hpp | 2 +- apps/gdalargumentparser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/argparse/argparse.hpp b/apps/argparse/argparse.hpp index a52142848192..029fa03c2c42 100644 --- a/apps/argparse/argparse.hpp +++ b/apps/argparse/argparse.hpp @@ -2086,7 +2086,7 @@ class ArgumentParser { std::stringstream stream; std::string curline("Usage: "); - curline += this->m_program_name; + curline += this->m_parser_path; const bool multiline_usage = this->m_usage_max_line_width < std::numeric_limits::max(); const size_t indent_size = curline.size(); diff --git a/apps/gdalargumentparser.cpp b/apps/gdalargumentparser.cpp index 724dcd91957b..3b795325345b 100644 --- a/apps/gdalargumentparser.cpp +++ b/apps/gdalargumentparser.cpp @@ -37,7 +37,7 @@ GDALArgumentParser::GDALArgumentParser(const std::string &program_name, [this](const auto &) { std::cout << usage() << std::endl << std::endl; - std::cout << _("Note: ") << m_program_name + std::cout << _("Note: ") << m_parser_path << _(" --long-usage for full help.") << std::endl; std::exit(0); })