gdal icon indicating copy to clipboard operation
gdal copied to clipboard

Doc: Clean up argument documentation for new CLI

Open dbaston opened this issue 1 month ago • 1 comments

Feature description

The argument documentation for the new CLI needs some cleaning up. I see the following problems:

  • the options that are unique to the tool being documented are intermixed with standard options like --input-format, making them hard to find
  • only a subset of standard options that apply to a given tool actually appear on that tool's documentation
  • options are not listed in any particular order
  • options are divided between sections like "Options", "Standard Options", and "Advanced Options" without any obvious distinction between them.

I would propose the following organization:

  1. Section "Program-Specific Options" that lists options that are either specific to a given tool, or have a behavior that may be specific to that tool (such as --band.) Options are listed in alphabetic order.
  2. Section "Standard Options" that lists all other options for that tool, again in alphabetic order. To avoid being visually overwhelming, we may want to bury this under a "collapse:: " directive.

Additional context

I started some work on a hackish Sphinx extension to help with this:

https://github.com/dbaston/gdal/blob/doc-fix-alg-options/doc/source/_extensions/check_program_options.py

It currently outputs about 700 undocumented program/option combinations. Some of these are false-positives.

dbaston avatar Nov 13 '25 15:11 dbaston

I would propose the following organization:

That sounds good to me. The current categorization comes from the early days of the framework before pipeline and other re-usable arguments, and can definitely be revised. That's not uniquely a documentation issue, but also the code must be changed to have SetCategory() consistent

rouault avatar Nov 13 '25 17:11 rouault