next up previous contents index
Next: C Glossary Up: Part III: Appendices Previous: A The .wipinit File

B Command Line Interface


WIP can always be run by specifying parameters and plot files on the command line. The command line interface is quite appropriate for command procedures and shell scripts.gif It is also very useful for getting a plot command file loaded into WIP.

The format for calling WIP from the command line is

wip [optionalArgs] [plotfile ...] [-e wipcmd]

where optionalArgs includes the following options:
[-d device] [--] [-x] [-r] [-b] [-g] [-q] [-h] [-?]

Except for the -e option (discussed below), the WIP options are, by convention, placed before any of the plot file names. The options may, however, appear anywhere on the command line (after the WIP command); but they are always evaluated before reading any of the plot files.

All items enclosed in square brackets ([...]) are optional. The following list explains the command line arguments and what function they perform.

-d device-type --
Sets the initial graphics device  to device-type. This option overrides the default device and any device specified in the user's .wipinit   file. See Section 3.1 on how to specify the device-type.
-- --
Specifies stdin as an input plot file. This may have some use when using WIP in a script. Note that this option also forces the -x option because input ends when all of data from stdin has arrived.
-x --
Effectively ``turns off'' the interactive state of WIP. After WIP has processed all of the plot files on the command line, a close plot command is issued and WIP exits. If the current graphics device is a hardcopy  device, then the hardcopy    command is issued when the last plot file has finished.
-r --
If WIP has been compiled with the READLINE library, then each time a user exits from WIP, a history file is written which contains all of the commands typed. This history file is read in by the READLINE routines when a user enters WIP again and the commands are available for recalling, editing, and executing. Use of this option suppresses the writing of the history file when the user exits from WIP. Any previous commands will still be available for recall and the READLINE editing capabilities will still exist.
-b --
This option completely disables the READLINE capabilities. This option may be useful for terminals that do not permit the escape sequences to be passed to the READLINE routines.
-g --
Opens WIP in debug mode. This is not generally useful to the user but might provide some additional comments in cases where the usual diagnostic messages don't help.
-q --
Turns off all informational messages from WIP. This is useful when the selected output file for the device is stdout. This option is disabled, however, when WIP enters interactive mode.
-h or -? --
Writes a usage statement listing all of the command line options available within WIP and then immediately exits. No plotting is done.

The remaining optional arguments to the WIP command (up to the optional -e flag) are the names of either macro  or plot command files . These files are only readgif        after the .wipinit   file has been read, the command line arguments set, and the initial device (if any) has been opened. The remaining arguments are then processed just as if the user had typed the command lines interactively. When the last file is finished being read, WIP moves into interactive mode (unless the ``-x'' option is used). All macros defined in the input files are now defined in WIP and all plot commands are present in the command buffer .

As an example of how to use the command line arguments, consider the following command:

wip -x -d myfile.wip

The file myfile.wip is a simple ASCII text file of commands (similar to the listings that appear in this manual or those saved with the write  command). This type of file is a useful way to insert a plot command listing, for playing back commands (say to another device), or for defining commonly used macros. The argument -d is the command line switch that WIP uses to redefine the initial device. This example illustrates how to specify a file name ( and associate with a hardcopy device (/vps). For more details on graphical devices, see Section 3.1. Finally, the -x flag tells WIP to exit when it is finished reading all of the command files on the command line (in this case, just the file myfile.wip).

Therefore, this command line example illustrates a quick way to spool a plot off to the printer without having to enter the interactive mode of WIP. This might be useful, perhaps, when putting together a paper where there are figures that will be used are generated at different times in the analysis stage. The plot commands can be saved to a file (like myfile.wip) as they are created. And then later, when the paper is ready to go out, they can be easily spooled off to the printer. Users familiar with Unix shell scripts will discover that this option can be quite useful (and welcome).

Finally, if the -e optional flag is present, it signals that the next and any remaining arguments are a single command to be issued inside WIP. That command can be any internal WIP command or a defined macro. The command is executed after all of the files on the command line have been loaded. If WIP is to be run interactively, this command is executed just before WIP enters interactive mode.

The usefulness of this option is seen as a generalization of the example above. Suppose the file myfile.wip defined a plot but required a file name as an argument. Rather than editing myfile.wip for each file, WIP can be called with the -e option and each file can be passed on the command line. For example, if the file myfile.wip defines a macro called dojob, then multiple files could be input as follows:

wip -x -d myfile.wip -e dojob file1
wip -x -d myfile.wip -e dojob file2

next up previous contents index
Next: C Glossary Up: Part III: Appendices Previous: A The .wipinit File