How to use PALCMD.EXE and PALCMD32.EXE |
Top Previous Next |
The standalone command-line version PALCMD.EXE (and 32-bits PALCMD32.EXE) is useful when you want to automate the process of creating reports. PALCMD.EXE uses the same engine as the GUI version PAL.EXE and produces the same output.
Run PALCMD.EXE from the command prompt using the following syntax:
PALCMD projectpath|sourcepath [options]
Options are read from the project file. Some of the settings may be overridden by options on the command-line (see above).
The command-line version can, in contrast to the GUI version, also analyze source code without first creating a project. Just supply a source code path on the command-line instead of a project path. PALCMD will then use the settings according to the template which is used for new projects. These settings are in PAL.INI which is located in C:\Documents and Settings\<acc>\Application Data\Peganza\Pascal Analyzer.
The PAL.INI file is specially handled by PALCMD. If "/I" parameter is used the PAL.INI file as pointed to by the path, will be read. Else, if a PAL.INI file exists in the same folder as the program file itself, it will read the PAL.INI file from that location, otherwise it will read it from the same folder as the GUI program does. The GUI program will read the PAL.INI file from the special folder under "C:\Documents and Settings". In this way, if you keep the PALCMD.EXE in a special folder, you can make sure that it always uses the correct default options, by copying the PAL.INI file to that folder. This PAL.INI file will then not be affected of any changes that you happen to make while running the GUI program.
If an error occurs when PALCMD is run, the application terminates with exit code 99.
Example:
PALCMD Shows help info and stops
PALCMD C:\projects\MyProj.pap Runs PALCMD and analyses c:\projects\MyProj.pap
PALCMD "C:\My Units\MyUnits.pas" /FM /CBP Runs PALCMD and analyses C:\My Units\MyUnits.pas with defaults as set in PAL.INI, but specifies that only the main file should be parsed, and that the compiler target is Borland Pascal 7.
PALCMD "C:\My Units\MyUnits.pas" /L=C:\PALCMD\Limits.txt Runs PALCMD and analyses C:\My Units\MyUnits.pas with defaults as set in PAL.INI. Uses limits set in Limits.txt (see below under /L)
You can also, starting from PAL 8, use just a file name as parameter, like:
PALCMD MyProj.pap
.. or
PALCMD MyUnits.pas
PALCMD will then check the current working directory for this file. If the current working directory is not specified, it will use the same directory as where the PALCMD program is located.
/BUILD specifies build configuration
This setting overrides the setting in the PAL.INI file or the project options. Please note that this setting is case-sensitive and must exactly match the name of the build configuration as stored in the DPROJ-file.
/D specifies conditional defines
This setting overrides the setting in the PAL.INI file or the project options. Conditional defines from source code and/or found in the Delphi project file will also be used.
/F specifies the report format (text, HTML, XML)
This setting overrides the setting for report format in the PAL.INI file or the project file.
/I specifies the path to PAL.INI
This forces PALCMD to use the PAL.INI pointed to by the supplied path.
/L specifies the path to a text file with limit info, in this case C:\PALCMD\Limits.txt.
For example, if the file contains this line:
WARN1=5
.. "WARN1" is the abbreviation for the section "'Interfaced identifiers that are used, but not outside of unit" in the Warnings Report. If then the number of warnings in a particular run of PALCMD.EXE exceeds 5, PALCMD.EXE will list it in the output.
When the number of warnings is less than the expected, it will also be listed.
The listings are also written to the Status Report.
You can add how many lines as you wish to the limit file. Each line will be checked against the specified section and report.
This feature is not available in PAL.EXE (the GUI program).
/NAME=projectname
Use this parameter to change the name for the created/used PAP-file, and also name for the report folder.
/P creates/uses a PAP file
When specifying only a source file and not a project file on the command-line, there will be no PAP file where to store information about new and old hits counts for reports. To easily allow for this, without having to create a PAP file, include the switch /P. A PAP-file will be created in the source folder. If it already exists, it will be used.
/PRIO=flag
Set process priority, see Windows API and SetPriorityClass for possible values.
/R specifies the report root folder
This setting overrides the setting for report folder in the PAL.INI file or the project file.
/S specifies search folders, separated with a semicolon
This setting overrides the setting for search folders in the PAL.INI file or the project file.
/T specifies the number of report threads to use
This setting overrides the setting in the PAL.INI file
/X specifies excluded search folders, separated with a semicolon.
It is also possible to use "<+>" to specify that subdirectories also should be excluded.
This setting overrides the setting in the PAL.INI file or the project file.
See also:
How to use PAL.EXE and PAL32.EXE |