Next: Examples of gnatname Usage, Previous: Running gnatname, Up: Handling Arbitrary File Naming Conventions with gnatname
Switches for gnatname must precede any specified Naming Pattern.
You may specify any of the following switches to gnatname:
--version
--help
--subdirs=`dir'
--no-backup
--and
-c`filename'
filename
(instead of the default
gnat.adc
).
There may be zero, one or more space between `-c' and
filename
.
filename
may include directory information. filename
must be
writable. There may be only one switch `-c'.
When a switch `-c' is
specified, no switch `-P' may be specified (see below).
-d`dir'
dir
. There may be zero, one or more
spaces between `-d' and dir
.
dir
may end with /**, that is it may be of the form
root_dir/**. In this case, the directory root_dir and all of its
subdirectories, recursively, have to be searched for sources.
When a switch `-d'
is specified, the current working directory will not be searched for source
files, unless it is explicitly specified with a `-d'
or `-D' switch.
Several switches `-d' may be specified.
If dir
is a relative path, it is relative to the directory of
the configuration pragmas file specified with switch
`-c',
or to the directory of the project file specified with switch
`-P' or,
if neither switch `-c'
nor switch `-P' are specified, it is relative to the
current working directory. The directory
specified with switch `-d' must exist and be readable.
-D`filename'
filename
.
There may be zero, one or more spaces between `-D'
and filename
.
filename
must be an existing, readable text file.
Each nonempty line in filename
must be a directory.
Specifying switch `-D' is equivalent to specifying as many
switches `-d' as there are nonempty lines in
file
.
-eL
-f`pattern'
gnatname -Pprj -f"*.c" "*.ada"
will look for Ada units in all files with the .ada
extension,
and will add to the list of file for project prj.gpr
the C files
with extension .c
.
-h
stdout
.
-P`proj'
proj
. There may be zero, one or more space
between `-P' and proj
. proj
may include directory
information. proj
must be writable.
There may be only one switch `-P'.
When a switch `-P' is specified,
no switch `-c' may be specified.
On all platforms, except on VMS, when gnatname is invoked for an
existing project file <proj>.gpr, a backup copy of the project file is created
in the project directory with file name <proj>.gpr.saved_x. 'x' is the first
non negative number that makes this backup copy a new file.
-v
stdout
.
This includes name of the file written, the name of the directories to search
and, for each file in those directories whose name matches at least one of
the Naming Patterns, an indication of whether the file contains a unit,
and if so the name of the unit.
-v -v
-x`pattern'
gnatname -x "*_nt.ada" "*.ada"
will look for Ada units in all files with the .ada
extension,
except those whose names end with _nt.ada
.