5.2. Command Line for gnatchop

The gnatchop command has the form:


$ prefix-gnatchop switches file name [directory]

The only required argument is the file name of the file to be chopped. There are no restrictions on the form of this file name. The file itself contains one or more Ada files, in normal XGC Ada format, concatenated together.

When run in default mode, gnatchop generates one output file in the current directory for each unit in the file. For example, given a file called hellofiles containing


procedure hello;
with Text_IO; use Text_IO;
procedure hello is
begin
   Put_Line ("Hello");
end hello;

the command


$ prefix-gnatchop hellofiles

generates two files in the current directory, one called hello.ads containing the single line that is the procedure spec, and the other called hello.adb containing the remaining text. The original file is not affected. The generated files can be compiled in the normal manner.

directory, if specified, gives the name of the directory to which the output files will be written. If it is not specified, all files are written to the current directory.