Skip to content

Commit

Permalink
gdaldem: fix help message for subcommands
Browse files Browse the repository at this point in the history
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 p-ranav/argparse#382
  • Loading branch information
rouault committed Nov 9, 2024
1 parent 0958e1b commit 6966463
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/argparse/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::size_t>::max();
const size_t indent_size = curline.size();
Expand Down
2 changes: 1 addition & 1 deletion apps/gdalargumentparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand Down

0 comments on commit 6966463

Please sign in to comment.