[GRASS-dev] [GRASS GIS] #953: module help information in machine-readable format

#953: module help information in machine-readable format
----------------------------+-----------------------------------------------
Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: default | Version: unspecified
Keywords: help, metadata | Platform: All
      Cpu: All |
----------------------------+-----------------------------------------------
The information returned from running "<module> help" would be useful for
a variety of interface=related tasks like auto-completion and automatic
menu building. Unfortunately, it is completely localized, making it
impossible to parse in a reliable fashion within scripts and computer
code.

I'm requesting the addition of a parameter to G_usage() which would
replace the human-readable section descriptions with markers which can be
relied upon to never occur in normal help text, e.g. "{{{KEYWORDS}}}\n",
then add a (e.g.) --help-data option. It would be helpful to also include
an unlocalized version of the keys for each of the description sections
(e.g., Description, Flags, Usage in an English localization).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/953&gt;
GRASS GIS <http://grass.osgeo.org>

#953: module help information in machine-readable format
--------------------------+-------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: default | Version: unspecified
Resolution: | Keywords: help, metadata
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by hamish):

{{{
unset LANG # (etc)
g.module --interface-description
   | piped to python XML parser
}}}

??

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/953#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#953: module help information in machine-readable format
--------------------------+-------------------------------------------------
  Reporter: cmbarton | Owner: glynn
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: default | Version: unspecified
Resolution: | Keywords: help, metadata
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by glynn):

* cc: grass-dev@lists.osgeo.org (added)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/953#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#953: module help information in machine-readable format
--------------------------+-------------------------------------------------
  Reporter: cmbarton | Owner: glynn
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: default | Version: unspecified
Resolution: | Keywords: help, metadata
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by glynn):

Replying to [ticket:953 cmbarton]:
> The information returned from running "<module> help" would be useful
for a variety of interface=related tasks like auto-completion and
automatic menu building. Unfortunately, it is completely localized, making
it impossible to parse in a reliable fashion within scripts and computer
code.

The --help output isn't appropriate for this. Use --interface-description
instead.

> I'm requesting the addition of a parameter to G_usage() which would
replace the human-readable section descriptions with markers which can be
relied upon to never occur in normal help text, e.g. "{{{KEYWORDS}}}\n",
then add a (e.g.) --help-data option. It would be helpful to also include
an unlocalized version of the keys for each of the description sections
(e.g., Description, Flags, Usage in an English localization).

I've added --help-text, which delimits the main sections of the --help
output with machine-readable markers, and also writes to stdout rather
than stderr.

Code should not attempt to parse the output further; if you want more
specific information, use the --interface-description output.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/953#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#953: module help information in machine-readable format
----------------------------+-----------------------------------------------
Reporter: cmbarton | Owner: glynn
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: Default | Version: unspecified
Keywords: help, metadata | Platform: All
      Cpu: All |
----------------------------+-----------------------------------------------

Comment(by hamish):

can we consider the wish completed?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/953#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#953: module help information in machine-readable format
----------------------------+-----------------------------------------------
Reporter: cmbarton | Owner: glynn
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: Default | Version: unspecified
Keywords: help, metadata | Platform: All
      Cpu: All |
----------------------------+-----------------------------------------------

Comment(by cmbarton):

Replying to [comment:5 hamish]:
> can we consider the wish completed?
>
Probably.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/953#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#953: module help information in machine-readable format
--------------------------+-------------------------------------------------
  Reporter: cmbarton | Owner: glynn
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 6.5.0
Component: Default | Version: unspecified
Resolution: fixed | Keywords: help, metadata
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by cmbarton):

  * status: new => closed
  * resolution: => fixed

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/953#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>