The command invocation for
$ gnatxref [switches] sourcefile1 [sourcefile2 ...]
These file names are considered to be regular expressions, so for instance specifying source*.adb is the same as giving every file in the current directory whose name starts with source and whose extension is adb.
You shouldn't specify any directory name, just base names. gnatxref and gnatfind will be able to locate these files by themselves using the source path. If you specify directories, no result is produced.
The switches can be:
gnatxrefwill parse the read-only files found in the library search path. Otherwise, these files will be ignored. This option can be used to protect Gnat sources or your own libraries from being parsed, thus making
gnatxrefmuch faster, and their output much smaller. Read-only here refers to access or permissions status in the file system for the current user.
aliand other extensions (e.g.
slifor SPARK library files) may be specified via this switch. Note that if this switch overrides the default, which means that only the new extension will be considered.
gnatxrefwill output the parent type reference for each matching derived types.
gnatfind will try to locate a
project file in the current directory.
If a project file is either specified or found by the tools, then the content
of the source directory and object directory lines are added as if they
had been specified respectively by `-aI'
gnatxrefwill then display every unused entity and 'with'ed package.
gnatxrefwill generate a tags file that can be used by vi. For examples how to use this feature, see Examples of gnatxref Usage. The tags file is output to the standard output, thus you will have to redirect it to a file.
All these switches may be in any order on the command line, and may even appear after the file names. They need not be separated by spaces, thus you can say `gnatxref -ag' instead of `gnatxref -a -g'.