gdaldem: fix help message for subcommands

Now:
```
$ gdaldem TPI --help
Usage: gdaldem TPI [--help] [--long-usage] [--help-general]
                   [-of <output_format>] [-compute_edges] [-b <value>] [-co <NAME>=<VALUE>]... [--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 <output_format>] [-compute_edges] [-b <value>] [-co <NAME>=<VALUE>]... [--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
This commit is contained in:
Even Rouault 2024-11-09 12:18:23 +01:00
parent 0958e1b978
commit 6966463cf1
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D
2 changed files with 2 additions and 2 deletions

View File

@ -2086,7 +2086,7 @@ public:
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<std::size_t>::max();
const size_t indent_size = curline.size();

View File

@ -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);
})