Opened 14 years ago

Closed 11 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 by hamish, 14 years ago

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

??

comment:2 by glynn, 14 years ago

Owner: changed from grass-dev@… to glynn

comment:3 by glynn, 14 years ago

Cc: grass-dev@… added

in reply to:  description comment:4 by glynn, 14 years ago

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 by hamish, 11 years ago

can we consider the wish completed?

in reply to:  5 comment:6 by cmbarton, 11 years ago

Replying to hamish:

can we consider the wish completed?

Probably.

comment:7 by cmbarton, 11 years ago

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