PPWIZARD Manual
[Bottom][Contents][Search][Prev]: Converting From SSI To PPWIZARD[Next]: /Beep

PPWIZARD Command Line

Windows NT/2000 users should be able to start PPWIZARD like this:

    PPWIZARD  [[+]InputMask] [@Project] [Options[:parms]]
    

OS/2 users can also use the syntax shown above but will need to have renamed "PPWIZARD.REX" to "PPWIZARD.CMD" for it to work.

Windows 95/98/ME and Unix users will probably need to use:

    REGINA PPWIZARD  [[+]InputMask] [@Project] [Options[:parms]]
    

As a simple example to build "tryme.htm" from the source file "tryme.it" one possible format of the command is:

    REGINA  PPWIZARD  tryme.it
    

Note that regina looks in the directories mentioned in the "REGINA_MACROS" environment variable for rexx scripts if they are not in the current directory (it does not use the "PATH" environment variable). Unless "ppwizard.rex" is located in a path mentioned in "REGINA_MACROS" then a command such as "regina ppwizard tryme.it" will fail unless ppwizard is in the current directory. Of course it will also fail if "regina" is not in one of the directories mentioned in the "PATH" environment or in the current directory.

Command Line: InputMask

You may specify more than one input mask and they may appear anywhere on the line (however none are processed until after all switches have been).

Each mask (anything that does not look like a switch/option) can be the name of a single file or may contain the normal wildcard characters for your operating system ("?" & "*" for OS/2 and Windows). See the documentation for your operating system for more details. Note that with a GETFILELIST hook you can enhance the way that the mask is handled.

If a mask (which may include a path) is preceeded by the "+" character then this indicates that you wish to process all files matching the mask in the indicated (or current) directory and all of it's subdirectories.

To specify the location where ppwizard will place the generated output files (current directory by default!) you need to use the /output switch. You may wish to also use a similar specification for the /DependsOn switch if you use it (if not, why not????).

Each source file may include other files such as common header files with your standard definitions.

If all input files end in the extension ".X" then the default processing mode is /rexx, the default situation is /html.

Command Line: @Project

PPWIZARD allows you to put all or some of your file specifications or switches into project (configuration) files with a default file extension of ".ppw" and easily refer to them from the command line.

PPWIZARD uses FindFile() to search for project files. Basically the project facility is a "smarter" version of the /List functionality (and easier to type!). If you need to refer to project files in specific directories then the "/list" switch is required.

PPWIZARD automatically looks for a specific project file (called "ppwizard.ppw"). By default if all input files have the same extension then ppwizard will also try to load an extension based project file, see the /@EXTN switch for more information.

See the /List switch for more details on the file format, but here is a sample configuration file (lets call it "all.ppw"):

;-----------------------------------------------------------------------
;--- This file builds HTML for all "*.IT" files in current directory ---
;-----------------------------------------------------------------------

*.IT                       ;;Only build files matching this mask
/DependsOn:DEP\*.DEP       ;;Only rebuild files that need it (new or modified)
/Output:OUT\*.htm          ;;I like files generated into the "out" directory and with the ".htm" extn

To use the "all.ppw" file shown above you could say:

    ppwizard @all
    

As shown above all "*.it" files will be processed if we wished to process a single file but still make use of the project file for the options then you would need to make use of the /DropFiles switch.

As documented for "/list" nothing stops one list or project file from loading others.

Command Line: Switches / Options

All Options begin with '/' unless running under UNIX where '-' is used instead.

Switches are executed in the following order:

  1. If the optional environment variable "PPWIZARD_OPTIONS" exists these are processed first.

  2. If the optional ppwizard "project" file "ppwizard.ppw" exists then this is processed via the /List switch. You can override any switches specified in the environment variable above if you need to. PPWIZARD first looks in the current directory and then in the same location as the ppwizard runtim if required.

  3. Any options specified on the command line. You can override any switches specified in the environment variable or project file above if you need to.

Normally files or options are separated by spaces, if the file or option needs to contain spaces then you can surround it by double quotes. If you use double quotes the quoted value must not contain double quotes (encode with "{x22}" - see below).

Commonly used options:

  1. /ConsoleFile
  2. /CrLf
  3. /Debug
  4. /DependsOn
  5. /ErrorFile
  6. /OnOK
  7. /OnERROR
  8. /Output
  9. /Pack
  10. /Rexx
  11. /Template

Validation options:

  1. /SpellAddWord
  2. /SpellCheck
  3. /SpellShowAll
  4. /WarningsRc

Less commonly used options:

  1. /#Include
  2. /$Trace
  3. /@Extn
  4. /**/
  5. /Beep
  6. /CGI
  7. /Color
  8. /CopyRight
  9. /DebugChars
  10. /DebugCols
  11. /DebugTime
  12. /Define
  13. /DependsOnComplete
  14. /DependsOnWarnings
  15. /DropFiles
  16. /Exclude
  17. /Exec
  18. /FileNames
  19. /FilterInput
  20. /FilterOutput
  21. /GetEnv
  22. /HideCmd
  23. /Hook
  24. /Html
  25. /HtmlGenerator
  26. /Inc2Cache
  27. /IncludePath
  28. /Info
  29. /List
  30. /Option
  31. /Other
  32. /RedirMethod
  33. /RegSyntax
  34. /Sleep
  35. /Validate
  36. /XSlash

How To Handle Tricky Characters

If you know the ASCII code of a character (in hex) you can encode it, for example "{x20}" represents a space. If a code looks invalid then it is ignored.

The following are codes for some of the more difficult command line characters you are likely to need:

LONG COMMAND LINES / CONFIGURATION FILES

PPWIZARD supports storing configuration information in the following ways:

  1. Environment Variables
    Using the /GetEnv switch you can easily retrieve previously stored command line options (possibly set up in "config.sys" or windows registry).

  2. In List File
    Using the /List switch you can easily retrieve command line options from a configuration file. A major advantage of a "list" file is that you do not have to handle characters such as '>' as you would have to if it came from the command line.

    Note that ppwizard will automatically read in any file named "ppwizard.ppw" (default project file). Also note the section above about "@Project" files.

RETURN CODES

The /ErrorFile and /ConsoleFile can help you capture any text output by ppwizard which can be particulary useful if you don't work from the command line.

EXAMPLE

This example has the following attributes:

  1. Make file functionality without the hassle.

  2. All source files have an extension of ".IT" (headers use ".IH").

  3. All output to have the extension ".html" and go into the "OUT" directory.
    +-[ MAKEIT.CMD ]------------------------------------------------+
    | @echo off                                                     |
    | md OUT        >nul 2>&1                                       |
    | md OUT\DEPEND >nul 2>&1                                       |
    | ppwizard %1.IT /Output:OUT\*.html /DependsOn:OUT\DEPEND\*.DEP |
    | if errorlevel 1 echo ERROR: Command failed!                   |
    +---------------------------------------------------------------+
    

Example - Redirection

Ppwizard (or any other program) can at times generate quite a lot of output. When /Debug is used you will definitely wish to "redirect" the output into a file, the following is an example which would work in virtually all operating systems (including linux bash shell - change switch characters to '-'!):

    ppwizard index.it /Output:OUT\*.htm /Debug   > OUT\output.TXT 2>&1
    

If the redirection example does not work you will need to read the documentation for the operating system you are using to determine the correct method.


[Top][Contents][Search][Prev]: Converting From SSI To PPWIZARD[Next]: /Beep

PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Tuesday January 02 2001 at 7:37am