Next: Project Files for gnatxref and gnatfind, Previous: gnatxref Switches, Up: The Cross-Referencing Tools gnatxref and gnatfind
gnatfind
SwitchesThe command line for gnatfind
is:
$ gnatfind [switches] pattern[:sourcefile[:line[:column]]] [file1 file2 ...]
where
pattern
Omitting the pattern is equivalent to specifying `*', which will match any entity. Note that if you do not provide a pattern, you have to provide both a sourcefile and a line.
Entity names are given in Latin-1, with uppercase/lowercase equivalence
for matching purposes. At the current time there is no support for
8-bit codes other than Latin-1, or for wide characters in identifiers.
sourcefile
gnatfind
will look for references, bodies or declarations
of symbols referenced in sourcefile, at line `line'
and column `column'. See see Examples of gnatfind Usage
for syntax examples.
line
column
file1 file2 ...
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'.
Not that if you specify at least one file in this part, gnatfind
may
sometimes not be able to find the body of the subprograms...
At least one of 'sourcefile' or 'pattern' has to be present on the command line.
The following switches are available:
-a
gnatfind
and gnatxref
will 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 gnatfind
and gnatxref
much faster, and their output much smaller.
-aIDIR
-aODIR
-nostdinc
-nostdlib
--RTS=
rts-pathgnatmake
flag (see Switches for gnatmake).
-d
gnatfind
will output the parent type
reference for each matching derived types.
-e
gnatfind
accept the simple regular expression set for
`pattern'. If this switch is set, then the pattern will be
considered as full Unix-style regular expression.
-f
-g
gnatfind
and gnatxref
.
-IDIR
-pFILE
gnatxref
and 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' and
`-aO'.
-r
gnatfind
will output only the information about the
declaration, body or type completion of the entities. If this switch is
set, the gnatfind
will locate every reference to the entities in
the files specified on the command line (or in every file in the search
path if no file is given on the command line).
-s
gnatfind
will output the content
of the Ada source file lines were the entity was found.
-t
gnatfind
will output the type hierarchy for
the specified type. It act like -d option but recursively from parent
type to parent type. When this switch is set it is not possible to
specify more than one 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'.
As stated previously, gnatfind will search in every directory in the
search path. You can force it to look only in the current directory if
you specify *
at the end of the command line.