PDA

View Full Version : Script generation of html difference


06-Mar-2006, 06:07 PM
Sirs --

Having read the tiny bit of documentation concerning scripting, I tried to create a script to generate an HTML report of the differences between two files. I need to be able to do this in an automated, non-interactive manner.

The following is that script:

# turn logging on
log normal C:\bc.log
load G:\diffs\c2008g G:\diffs\c2008h
select cxx8.ada cxx8.ada
file-report layout:side-by-side options:line-numbers output-to:C:\blip.html output-options:html-color

The files I'm trying to compare are C:\diffs\c2008g\cxx8.ada and C:\diffs\2008h\cxx8.ada.

Of course, this script fails. The error message given is "incorrect parameters", which basically translates to "You have done something wrong". Yeah, I have done something wrong. Probably. I have tried several stabs in the dark at guessing how to make this work, all to no avail. The above script is merely the last of those stabs.

Is there any documentation available as to what the script commands mean? I have read the abbreviated summary in "Scripting Reference". It shows the syntax but not the meaning of the commands. Without knowing what the commands do I can't see how I can accomplish this, or any other, simple task. I feel somewhat confident that the inscrutable error message has something to do with my use of the 'select' command, but without knowing what the command does or is supposed to do, I don't see any way out of the "incorrect parameters" swamp.

Does anyone have a suggestion as to where documentation can be obtained for the scripting commands?

Chris
07-Mar-2006, 01:51 PM
The select command doesn't take specific file names as arguments. Instead, filter based on file name, then select the files to be in the report.

# turn logging on
log normal C:\bc.log
filter "cxx8.ada"
load G:\diffs\c2008g G:\diffs\c2008h
select all.files
file-report layout:side-by-side options:line-numbers output-to:C:\blip.html output-options:html-color

The Command Line & Scripting section in the help file is the main resource for scripting information. This forum is the other good place to look for examples.

From the scripting reference, valid arguments to the select command are:

A selection mask has the format, [<side>.][<difference>.]<item>.

A side (left or lt, right or rt, all) limits the selection to the specified side. By default, all is used.
A difference (exact, diff, newer, older, orphan, all) limits the selection based on results of comparison. diff refers to differences in criteria other than timestamps. Use newer or older instead. Folders must contain only the specified result type to be affected. By default, all is used.
An item (files, folders, all) limits the selection to files, folders, or both.