PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: Converting From SSI To PPWIZARD[Next]: Project Files

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 (make sure PPWIZARD is named "PPWIZARD.CMD").

Windows 95/98/ME and Unix users will probably need to use (and NT/2000 users can use):

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

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

    REGINA  PPWIZARD  tryme.it
    

You should read up about curley codes as these can be used to take care of difficult characters such as spaces, another example is if you had a filename or mask that begins with a minus sign (this normally indicates the start of a command line switch). Spaces can also be handled by surrounding any item on the command line with a range of "quote" characters. This can be very handy in cases where the normally useful double quotes are causing problems (getting dropped by operating system etc). The quote characters you can use include single, double and backwards quotes as well as the "~!#$%^([" characters. If "(" or "[" is used the matching end quote is ")" or "]", otherwise the starting and ending quote characters are the same, valid examples are 'one parm' and [one parm].

Any item that starts with ';' (such as ";/debug) is commented out and is ignored. This should be helpful when testing combinations of switches.

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.

Be careful with spaces, the only spaces that are ignored are extra ones between switches or input masks. PPWIZARD does not do space reduction elsewhere so "/output:*.htm" is not the same as "/output: *.htm" (in the latter you are saying the output filename should start with a space).

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. Note that for some operating systems ppwizard gets passed a pre-expanded list of files and never sees the wildcards, if this is not what you want you can always use curley codes to hide the value from the operating system or regina (or use the /Input switch).

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 (external) files such as common header files containing your standard definitions and macros.

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

Each file has an associated base directory, to override the default value (the masks directory) you can use the /BaseDir switch or imbed the "{ENDBASE}" (upper case) string within the InputMask after one of the slashes (the string marks the end of the base directory). Note that if you do mark the base directory this way the Input mask should specify a full path (or begin with '.' or '..' followed by a slash). An example of specifying the base directory would be "c:\projects\source\main\{ENDBASE}subdir1\*.IT".

There is a special type of "InputMask" which begins with "?\" or ("?/" in Unix) which indicates that you wish PPWIZARD to find a single specific file (no wildcard characters etc), The FindFile() routine is used to locate the file. This type of mask should not begin with "+".

Note that in Unix in you may wish to use the "-Input" switch to specify masks (this delays their expansion, PPWIZARD does it).

By default PPWIZARD wants at least one file to match every mask and at least one file to match over all masks, to alter this you will need to use the /0OK switch.

Command Line: Switches / Options

All Options begin with '/' or '-' and 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 runtime if required.

  3. Any options specified on the command line. You can override any switches specified in the environment variables or project files 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}").

Available switches are:

  1. /BaseDir
  2. /Beep
  3. /CGI
  4. /Color
  5. /ConsoleFile
  6. /Copy
  7. /CopyRight
  8. /CrLf
  9. /Debug
  10. /DebugChars
  11. /DebugCols
  12. /DebugTime
  13. /Define
  14. /DeleteOnError
  15. /DeletePrev
  16. /DependsOn
  17. /DependsOnComplete
  18. /DependsOnWarnings
  19. /DropFiles
  20. /ErrorFile
  21. /Exclude
  22. /Exec
  23. /FileNames
  24. /FilterInput
  25. /FilterOutput
  26. /GetEnv
  27. /HideCmd
  28. /Hook
  29. /Html
  30. /HtmlGenerator
  31. /Inc2Cache
  32. /IncludePath
  33. /Info
  34. /Input
  35. /List
  36. /Making
  37. /OnERROR
  38. /OnOK
  39. /Option
  40. /Other
  41. /Output
  42. /OutHeader
  43. /Pack
  44. /RedirMethod
  45. /RegSyntax
  46. /Require
  47. /Rexx
  48. /Sleep
  49. /SpellAddWord
  50. /SpellCheck
  51. /SpellShowAll
  52. /Syntax
  53. /Template
  54. /UNC
  55. /Validate
  56. /WarningsRc
  57. /XSlash
  58. /0OK
  59. /#Include
  60. /$Trace
  61. /**/
  62. /@Extn

LONG COMMAND LINES / CONFIGURATION FILES

PPWIZARD has no restrictions on the length of a command line although your operating system is likely to (about 126 characters in WIN95/98/ME).

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).

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 '-'!):

    [regina] 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. If this failed on Windows NT or 2000 (one of the 1,234,657 bugs!) then you will need to specify the regina interpreter first ("regina ppwizard" etc).


[Top][Contents][Search][Prev]: Converting From SSI To PPWIZARD[Next]: Project Files

PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Thursday January 17 2002 at 6:27pm