Help extensions

Introduction

To provide extensions to the *Help command for library commands, a service was added in RISC OS Select 2. The Help Query service allows modules to provide additional information about a requested command when the command is not present within the resident modules.

Help requests are separated into four major groups:

Before Select 2 the only help returned was that of the module commands. The new service call allows additional help messages to be returned for other keywords. This facility is used by the LibraryHelp module to display details about library commands from a text file within the library.

Library help

The LibraryHelp module searches the path Run:Help.<keyword> to locate a text file containing the help text for a command. Library commands should therefore be distributed with a Help directory containing a file of the same name which describes the command's function. For example, the command 'Finger' is described in the file 'Help.Finger'. The format of the file is important for consistency with the rest of the operating system commands.

The first line of the file must be of the form <command>, a tab, <x.yy>, a space, and then (<dd> <mmm> <yyyy>). This allows the module to interpret the line and display it when a *Help Library command is issued. For example:

IfThere<tab>1.04 (20 Dec 2001)

Subsequent lines of the file are printed in a formatted manner similar to that of SWI OS_PrettyPrint. Lines following a tab are wrapped back to the offset of the tab. The usual form of command help is:

The *<command name> command is used to <purpose>. <other usage information>.
Syntax: *<command name> <switches and parameters>
Switches:
<switch name><tab><switch description>

Authors should examine the supplied help files for other examples and aim for consistency where possible. As with all commands, the following conventions are expected:

Where the syntax of a command is complex, multiple lines should be used to describe alternate forms. For example, see the help output used by INetStat. Where the syntax is still too complex to describe, either indicate that more details can be obtained by using the command with a particular syntax, refer the user to external documentation, or simplify the command.

Services

Service_HelpQueryService Call &D6
A help query has been made for a keyword which the OSCommands module does not resolve
R0=Pointer to query token (space or ctrl terminated)
R1=&D6 (Service_HelpQuery)
R2=
Bit(s)Meaning
0-3Query type:
ValueMeaning
0Pre-command (aliases)
1Post-command, pre-module (library commands)
2Post-module (generic information)
3-15Reserved for future expansion
4-31Reserved, must be 0
R7=0 if no entries have been displayed yet, 1 if entries have been displayed
R0 - R2preserved
R7=1 if this module processed the query, otherwise preserved

This service is issued by the OSCommands module to inform clients that a help query has been made. You should examine the query token passed in R0 and display any help you can provide on it. Help messages should be prefixed by ==> Help on keyword <keyword> (<source>). If R7 is 1 on entry, write a newline before printing this, so that messages are separated by blank lines. Abbreviated commands are indicated by a period ('.').

This call should never be claimed.