Next: , Previous: Running gnatname, Up: Handling Arbitrary File Naming Conventions Using gnatname


9.3 Switches for gnatname

Switches for gnatname must precede any specified Naming Pattern.

You may specify any of the following switches to gnatname:

-cfile
Create a configuration pragmas file file (instead of the default gnat.adc). There may be zero, one or more space between -c and file. file may include directory information. file must be writeable. There may be only one switch -c. When a switch -c is specified, no switch -P may be specified (see below).
-ddir
Look for source files in directory dir. There may be zero, one or more spaces between -d and dir. When a switch -d is specified, the current working directory will not be searched for source files, unless it is explictly 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 -c must exist and be readable.
-Dfile
Look for source files in all directories listed in text file file. There may be zero, one or more spaces between -d and dir. file must be an existing, readable text file. Each non empty line in file must be a directory. Specifying switch -D is equivalent to specifying as many switches -d as there are non empty lines in file.
-h
Output usage (help) information. The output is written to stdout.
-Pproj
Create or update project file proj. There may be zero, one or more space between -P and proj. proj may include directory information. proj must be writeable. There may be only one switch -P. When a switch -P is specified, no switch -c may be specified.
-v
Verbose mode. Output detailed explanation of behavior to 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
Very Verbose mode. In addition to the output produced in verbose mode, for each file in the searched directories whose name matches none of the Naming Patterns, an indication is given that there is no match.
-xpattern
Excluded patterns. Using this switch, it is possible to exclude some files that would match the name patterns. For example, "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.