Opened 10 years ago

Closed 7 years ago

#953 closed enhancement (fixed)

module help information in machine-readable format

Reported by: cmbarton Owned by: glynn
Priority: normal Milestone: 6.5.0
Component: Default Version: unspecified
Keywords: help, metadata Cc: grass-dev@…
CPU: All Platform: All

Description

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).

Change History (7)

comment:1 Changed 10 years ago by hamish

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

??

comment:2 Changed 10 years ago by glynn

Owner: changed from grass-dev@… to glynn

comment:3 Changed 10 years ago by glynn

Cc: grass-dev@… added

comment:4 in reply to:  description Changed 10 years ago by glynn

Replying to 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.

comment:5 Changed 7 years ago by hamish

can we consider the wish completed?

comment:6 in reply to:  5 Changed 7 years ago by cmbarton

Replying to hamish:

can we consider the wish completed?

Probably.

comment:7 Changed 7 years ago by cmbarton

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.