About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/ahelp.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 ahelp Context: ahelp

Synopsis

Access the CIAO help documentation.

Syntax

ahelp [-n width] [-s|-m|-l|-w|-i] subject
ahelp [-n width] [-s|-m|-l|-w|-i] context subject
ahelp [-n width] -b blockname [-t attribute] subject
ahelp [-n width] -b blockname [-t attribute] context subject
ahelp [-n width] -c context
about keyword

Description

The ahelp command accesses the CIAO on-line documentation. By default it displays an ASCII version of the help file, although it can be used to cause HTML versions to be shown in a web browser using the "-i" or "-w" flags. The CIAO site contains HTML versions of the help files, which are also available on the European mirror site.

Finding help for a given subject

The help files are arranged by subject into contexts (both subject and context are a single word) and you access these files by either:

  unix% ahelp <subject>

or

  unix% ahelp <context> <subject>

depending on whether or not there are help files with the same subject but different contexts (ahelp will tell you if you need to specify a context). The ahelp tool is case insensitive when it comes to matching the subject and context values.

Searching for help

If you do not know the exact subject (for a tool, the subject is just the tool name), then you enter

  unix% about <keyword>

for a list of subjects related to your query (ie whatever value you use for <keyword>). To find out all the entries for a given context you use

  unix% ahelp -c <context>

If a search only returns one match then that page is automatically displayed, otherwise you will see a list of subjects, with context and synopsis, that match the search.

Using regular expressions

The CIAO 3.0 release of ahelp adds the ability to use a regular expression when specifying any of the subject, context, or keyword in a search. So, to find a list of all the keywords that contain the text "par", you need to say:

  unix% ahelp /par/

and to list all help files with contexts that begin with "sl":

  unix% ahelp -c /^sl/

This feature can be very useful when trying to search for help on a particular subject, since

  unix% about /bin/

will list all help files whose references include the text "bin" (so this would match bin, rebin, and binned amongst others).

There are a number of resources that describe the extended regular expression syntax used here: "man regexp" may provide details (depending on what system you are using) and there are many pages on the internet.

Listing specific sections of the help file

The "-b blockname" option, introduced in CIAO 3.0, is used to restrict the output to a given section of the help file. This can be useful if you only need specific information, such as the list of known bugs, description of a specific parameter, or the syntax of a given command.

Allowed values for the "-b blockname" option

blockname Description
SYNOPSIS Displays the synopsis section.
SYNTAX Displays the syntax section.
DESC Displays the main body of the help file, which is the part between the initial synopsis/syntax and the examples/parameter list.
QEXAMPLELIST Displays the examples.
PARAM Displays the parameter section. When used with the "-t name" option, only the description of the parameter matching name is listed.
ADESC Displays any ancillary description section that is displayed after the examples/parameter list. These sections are numbered and may contain a title; if so then the "-t name" option can be used to select just that part of the description.
BUGS Display any bugs section.
LASTMODIFIED Displays the date the file was last modified.
VERSION Displays the version of the help file.

It is not guaranteed that a help file will contain all these sections. The "Structure of a help file" section at the end of this file provides more details on what is included in a help file.

Finding help in ChIPS and Sherpa

The "ahelp" and "about" commands can also be used at the ChIPS and Sherpa prompts to access the help files. The context - if not explicitly specified - is taken to be the name of the tool (ie chips or sherpa). When using regular expressions it is best to surround them in single or double quotes.

Command-line options

The most useful options are given below. If no option is supplied, ahelp defaults to -l.

Option Details
-l display the synopsis, syntax summary, description, and examples.
-m display the synopsis, syntax summary, and examples.
-s display the synopsis and syntax summary.
-b blockname Displays only a specific section of the help file. The value of blockname can be one of: SYNOPSIS, SYNTAX, DESC, QEXAMPLELIST, PARAM, ADESC, BUGS, LASTMODIFIED, and VERSION (upper case is required).
-t attribute Only valid when the -b option is used and blockname is either PARAM or ADESC. The output is restricted to the section that matches the value of attribute - the parameter name for PARAM or the section title (without the leading number) for ADESC.
-w as -l, but display the HTML version (from the CIAO directory $ASCDS_INSTALL/doc/html/) in a web browser.
-i as -l, but display the HTML version (from the CIAO web site http://cxc.harvard.edu/ciao/ahelp/) in a web browser.
-k keyword Returns the results of a search for pages related to the supplied keyword. The keyword can be a regular expression of the form /expression/, in which case the help system is searched for all files that match the given expression. "ahelp -k keyword" is equivalent to "about keyword".
-n value Instead of formatting the text to match the width of the screen display, use the supplied value.

Options for the CIAO developer

There are several other options that are only useful to CIAO developers and those that install the CIAO software.

Option Details
-f <filename> Display the contents of the supplied ahelp file.
-r [<path>] Re-create the ahelp database using the contents of the doc/xml/ and contrib/doc/xml/ sub-dirctories of <path> - if given - otherwise $ASCDS_INSTALL.

Configuring ahelp

Ahelp uses the PAGER environment variable to find the program to use to page the ASCII output to the screen: examples of suitable values are more or "less -s".

If you make use of the "-b" option in ahelp a lot it may be worth setting up aliases for them. For instance, the following csh/tcsh commands

  unix% alias bugs     'ahelp -b BUGS '
  unix% alias params   'ahelp -b PARAM '
  unix% alias examples 'ahelp -b QEXAMPLELIST '

provide easy access to the bugs, parameter, and examples section of a help file - if they exists - by saying "bugs dmstat", "params aconvolve" ("params -t kernelspaec aconvolve" to list an individual parameter), or "examples dmfilth".

The "Choosing a web browser" section below the Examples describes how you can change what web browser to use when ahelp is called with either the -i or -w flag.

Example 1

ahelp

Displays this help file (it is the same as doing "ahelp ahelp").

Example 2

ahelp dmcopy

Displays the full help file for the dmcopy tool.

Example 3

about grating

Displays a list of subjects that are cross-referenced using the keyword "grating". it is equivalent to

  unix% ahelp -k grating

Example 4

ahelp /struct/

Lists all help files with a subject that contains the text "struct". If there is only one match then that help file will be displayed, otherwise the subject, context, and synopsis information for each matching file will be found.

Example 5

about /struct/

Lists all help files which are cross-referenced by a string that contains the text "struct".

Example 6

ahelp /stk/
ahelp tools /stk/

The regular-expression support can be combined with restricting a search to a particular concept. The first ahelp call lists all help files whose subject contains "stk", whereas the second one restricts the search to those subjects in the "Tools" concept.

Example 7

ahelp -c sherpa

Gives a list of all available subjects within the `sherpa' context, along with their synopsis.

Example 8

ahelp -b BUGS dmstat

Displays the bugs section of the dmstat help file.

Example 9

ahelp -b QEXAMPLELIST dmstat

Displays the examples section of the dmstat help file.

Example 10

ahelp -b PARAM dmcopy

Displays the parameter section of the dmcopy help file.

Example 11

ahelp -b PARAM -t infile dmcopy

Displays the description of the infile parameter of dmcopy.

Example 12

ahelp -b ADESC dmstat

There may be additional text in a help file after the examples/parameters but before the BUGS section. These are referred to as ADESC sections, and may have a title (if so they will be numbered). in this example we display all such sections from the dmstat help file.

Example 13

ahelp -b ADESC -t 'CHANGES IN CIAO3.0' dmstat

If an "ADESC" section has a title then you can select just that section using the "-t" option. Here we display the 'CHANGES IN CIAO 3.0' section of the dmstat help file (note that the number preceeding the section title - in this case '1.' - should not be included in the "-t" option).

Example 14

ahelp -s dmcopy

Gives a short (synopsis and syntax) help for the tool dmcopy.

Example 15

ahelp -w dmcopy

Displays the HTML version of the dmcopy help file in a web browser (Netscape by default). See the section below on "Choosing a web browser" for information on how to change the browser.

The HTML file displayed is included in the CIAO distribution - in the directory $ASCDS_INSTALL/doc/html/ - so a connection to the internet is not required (unlike the -i option).

Example 16

ahelp -i dmcopy

Displays the HTML version of the dmcopy help file from the Ahelp pages of the CIAO web site. See the section below on "Choosing a web browser" for information on how to change the browser.

Since the HTML file being displayed is from the CIAO web site - unlike the -w flag - then a connection to the internet is required. The advantage over using the -i option is that the version of the help file on the CIAO web site may be more recent than the version in the CIAO distribution.

Example 17

ahelp -n 35 chips

Displayes help information about chips formatted as 35 columns per line.

Example 18

ahelp -n 100 -b PARAMLIST acis_process_events

Displayes help information on the parameters of acis_process_events assuming there are 100 columns per line. One useful trick is to use taskmonitor to display the output:

  unix% taskmonitor "ahelp -n 100 -b PARAMLIST acis_process_events" &

Example 19

ahelp -s -f /mydir/myfile.xml

Processes the supplied file and displays a short version of the help information stored in /mydir/myfile.xml.

Example 20

ahelp -r /mydir/

Re-creates the database of the help files located in /mydir/doc/xml/ and /mydir/contrib/doc/xml/.

CHOOSING A WEB BROWSER

If you use the -i or -w flags than ahelp will display the help file in a web browser rather than in the terminal window. The default browser that is used is Netscape, and it will re-use an existing Netscape browser if one already exists when ahelp is called.

It is possible to change both which browser is used and its behaviour by adding to (or changing) the file .CXCdefaults in your home directory (see 'ahelp gui' for further information on this file). The default values for these fields - which can be found in $ASCDS_INSTALL/config/system/CXCdefaults - are:

  *HelpBrowser                 : netscape
  *HelpBrowserDelay            : 3
  *HelpBrowserOpenURLCommand   : netscape -remote 'openURL($)'
  *HelpBrowserOpenFILECommand  : netscape -remote 'openFile($)'

The meanings of the fields is given in the following table:

Field Description
HelpBrowser The name of the browser; if a running process is not found with this name then the command is run as a background process and ahelp will wait HelpBrowserDelay seconds before continuing. This field need not be set; in particular if the browser does not support a means of setting the location of an existing copy then the field should be left empty.
HelpBrowserDelay The delay (in seconds, converted to an integer) to wait after starting the browser (name given in the HelpBrowser field). This should be increased if it is found that the browser takes so long to start up that ahelp has already finished (and so the requested page is not displayed in the browser).
HelpBrowserOpenURLCommand This command is used to open a URL (for when 'ahelp -i' is used). If the command does not exit immediately then it must end with a '&'.
HelpBrowserOpenFILECommand This command is used to open a file (for when 'ahelp -w' is used). If the command does not exit immediately then it must end with a '&'.

All '$' signs in the "OpenURL" and "OpenFILE" command strings will be replaced by the name of the file or URL to display (if you need to include a dollar sign then use '\$'). As an example, with the default settings,

  unix% ahelp -i dmcopy

will use the HelpBrowserOpenURLCommand value of

netscape -remote 'openURL($)'

which will be expanded to

netscape -remote 'openURL(http://cxc.harvard.edu/ciao/dmcopy.html)'

Below we provide a number of configurations suitable for some of the more popular web browsers. First we list the values suitable for the Solaris and Linux platforms.

Mozilla

  *HelpBrowser                : mozilla
  *HelpBrowserDelay           : 3
  *HelpBrowserOpenURLCommand  : mozilla -remote 'openURL($)'
  *HelpBrowserOpenFILECommand : mozilla -remote 'openFile($)'

Konqueror

With the following settings a new konqueror session will be started each time 'ahelp -i' or 'ahelp -w' is used.

  *HelpBrowser                :
  *HelpBrowserDelay           :
  *HelpBrowserOpenURLCommand  : konqueror $ &
  *HelpBrowserOpenFILECommand : konqueror $ &

Konqueror

With the following settings, 'ahelp -i' or 'ahelp -w' will use an existing konqueror (starting one if it does not).

  *HelpBrowser                : konqueror
  *HelpBrowserDelay           : 3
  *HelpBrowserOpenURLCommand  : dcop `dcop konqueror-\* | head -1` konqueror-mainwindow\* 'openURL(QString)' $
  *HelpBrowserOpenFILECommand : dcop `dcop konqueror-\* | head -1` konqueror-mainwindow\* 'openURL(QString)' $

Lynx

  *HelpBrowser                :
  *HelpBrowserDelay           :
  *HelpBrowserOpenURLCommand  :  xterm -e lynx $ &
  *HelpBrowserOpenFILECommand :  xterm -e lynx $ &

Opera

  *HelpBrowser                :  opera
  *HelpBrowserDelay           :  3
  *HelpBrowserOpenURLCommand  :  opera -remote 'openURL($)'
  *HelpBrowserOpenFILECommand :  opera -remote 'openFile($)'

For OS-X systems the configuration options look a little different:

Safari

  *HelpBrowser                :
  *HelpBrowserDelay           :
  *HelpBrowserOpenURLCommand  :  open $ &
  *HelpBrowserOpenFILECommand :  open -a Safari file://$ &

Mozilla (on OS-X)

  *HelpBrowser                :
  *HelpBrowserDelay           :
  *HelpBrowserOpenURLCommand  :  open $ &
  *HelpBrowserOpenFILECommand :  open -a Mozilla file://$ &

CHANGES IN CIAO 3.1

Consistent behavior with the -i/-w flags

The ahelp command now behaves the same whether you used the "-i" or "-w" flag or not. Prior to the CIAO 3.1 release, commands like "ahelp -i stat" would fail, claiming to be unable to find any information on the subject, whereas "ahelp stat" would return a list of matches. Now this list is also displayed when "-i" or "-w" are used.

Choice of web browser

In CIAO 3.0.2 only the first '$' character in the "*HelpBroswerOpen*Command" strings would be expanded to contain the file to display. In CIAO 3.1 all '$' characters are expanded.

CHANGES IN CIAO 3.0.2

Choice of web browser

In CIAO 3.0.2 ahelp was changed to allow the web browser used by "ahelp -i" and "ahelp -w" to be configured rather than always using Netscape. Note that the default browser is Netscape on all platforms, including OS-X.

See the "Choosing a web browser" section above for further information.

CHANGES IN CIAO 3.0

Using regular expressions

In CIAO 3.0 it is possible to use a regular expression when giving the subject, context, or keyword when calling ahelp. The syntax used for the regular expression matches that of the UNIX extended regular expression standard.

Listing a specific section of the help file

The -b option can be used to list a specific part of the help file, such as the bugs section or the parameter list.

Specifying the context for a subject

As of CIAO 3.0 you no longer need to use the -c option to specify the context if you are also giving the subject. So, what used to require

  unix% ahelp -c varmm print

is now just

  unix% ahelp varmm print

The -c is still required if only the context is given.

Removal of extraneous control characters

The text output of ahelp no longer ends in unwanted control characters when the PAGER environment variable is set to "less".

STRUCTURE OF A HELP FILE

The basic layout of a help file is as follows (although some sections will not appear in all files).

Section Description
SYNOPSIS Provides a short overview of the help file
SYNTAX How to call the command or tool
DESCRIPTION This section contains the main body of the help text
EXAMPLES Examples of how to use the tool or command
PARAMETERS Lists the parameters of the tool, first as a table and then as a detailed list.
Additional description This section is used to provide additional information that is not relevant to day-to-day use of the tool/command. This text (that appearing under the "Structure of a help file" title) is an example of such a section.
BUGS This section describes bugs and issues that are known about the tool when CIAO was released. As described below, the CIAO web site should be consulted to see if any newer items have been found.
SEE ALSO This section lists related help files in the format of "subject(context)". These can then be followed using "ahelp subject" or "ahelp context subject" on the command line, or by using the links in the HTML versions. It provides a useful way to explore the CIAO help documentation.

To find out if any issues or bugs have come to light since the release please visit the bugs section of the CIAO web pages.

Bugs

See the bugs page for this tool on the CIAO website for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.