

Command Line Options
When invoking a nu/TPU session, all that is required is the command:
tpu [filename]
Even the filename is optional. nu/TPU command line switches can be added to
the command to alter the behavior of the editing interface. The switches provide
control and flexibility over how the interface will process. The following
section shows command line syntax and describes the details for each of the command
line options.
nu/TPU Command Line Syntax
tpu [{/-}switch[=value]...] [filename specification]
UNIX/DOS: tpu -sec=./mysec.ini -comm=mycom.tpu file.nam
VMS: edit/tpu /sec=[]mysec.ini /comm=mycom.tpu file.nam
There are four elements to command line syntax which need to be highlighted.
First, the space preceding each switch is required. Second, the switch character
must match the operating system switch style unless changed via the defaults
file. Third, no spaces are allowed either before or after an equals sign (=).
Lastly, only three characters are needed to distinguish command line options.
nu/TPU implements all of the command switches listed in the table below.
Filename specifications must be made with the appropriate UNIX, MS-DOS, or VMS
syntax.
nu/TPU Command Line Switches Default Values
[NO]COMMAND [=file_name] tpuini.tpu
[NO]CREATE CREATE
[NO]DEBUG[=file_name] NODEBUG
[NO]DISPLAY DISPLAY
ENVIRONMENT off
HELP off
[NO]INITIALIZATION[=file_name] si_init.si
[NO]JOURNAL [=file_name] 00000000.tjl
[NO]MODIFY MODIFY
[NO]OUTPUT [=file_name] OUTPUT
[NO]READ_ONLY NOREAD_ONLY
[NO]RECOVER NORECOVER
[NO]SECTION [=file_name] si.sec
START_POSITION [=line,column] 1,1
UNREGISTER off
[NO]WRITE WRITE
In addition to specifying runtime options at the command line, nu/TPU has a
DEFAULTS FILE feature. The defaults file provides a simple way for users to
automatically specify command line switches. A setting for each of the command line
switches can be specified in the defaults file. Using a defaults file is not
required, but it does provide an effective means for reducing command line input
and duplication of both section and command files across the system.
The nu/TPU built-in GET_INFO can be used to extract information about the
switches used on the command line. GET_INFO calls are available for each of the
switches to determine if the switch was specified on the command line. Some of the
switches will return a true value from the GET_INFO call if they were defined
as part of nu/TPU default runtime settings. For switches that take arguments,
the argument value can also be extracted. For detailed information on the
GET_INFO built-in, refer to the nu/TPU built-in reference section. GET_INFO examples
are provided in the command switch descriptions.
The remainder of this section discusses all command line options. Default
values are shown at the start of each subsection.
COMMAND (tpuini.tpu default)
UNIX/DOS: -[NO]COMMAND[=command_file]
VMS: /[NO]COMMAND[=command_file]
The COMMAND switch is used to determine whether a file containing nu/TPU code
is compiled and executed prior to starting the edit session. The resulting
executable code is layered on top of the current section file definitions. Command
files can be used for startup processing, but they are not executed as fast as
precompiled section files. A section file or a command file must be used to
start up a nu/TPU edit session.
nu/TPU will look for the default command file tpuini.tpu in the nu_tpu/common
directory. To avoid looking up a command file, use the /NOCOMMAND switch. If a
command file is requested but cannot be found, the session will continue to
process as if the command file was not requested.
Example
Compile and execute the command file si_mods.tpu, which is located in the current directory. The new executable code is
layered on top of the default si interface. The command file executes after the initialization process for si is completed.
UNIX/DOS: tpu -command=si_mods.tpu
VMS: edit/tpu /command=si_mods.tpu
To build a new editing interface from scratch, use the NOSECTION switch along
with the command file to build the new editor.
UNIX/DOS: tpu -nosection -command=mini.tpu
VMS: edit/tpu /nosection /command=mini.tpu
! GET_INFO call to extract the command filename if the COMMAND switch is used.
IF GET_INFO (COMMAND_LINE, ‘command’) THEN
name := GET_INFO (COMMAND_LINE, ‘command_file’);
ENDIF;
CREATE (CREATE default)
UNIX/DOS: -[NO]CREATE
VMS: /[NO]CREATE
The CREATE switch is used to control whether or not a new file is created if a
file matching the input filename specification is not found.
If the /NOCREATE switch is used and there is no matching file for the input
filename, the nu/TPU session is ended and control is returned to the operating
system. The si interface uses CREATE as the default.
Example
The following prohibits the creation of a new login file. If the file exists,
it may be updated.
UNIX/DOS: tpu -nocreate login
VMS: edit/tpu /nocreate login
! GET_INFO call to extract nocreate status.
CREATE$ALLOW := GET_INFO (COMMAND_LINE, ‘create’)
DEBUG (NODEBUG default)
UNIX/DOS: -[NO]DEBUG[=file_name]
VMS: /[NO]DEBUG[=file_name]
DEBUG determines whether nu/TPU uses the debugger to load, compile, and
execute the debugger file’s contents. If DEBUG is specified, the debugger file is
processed prior to the TPU$INIT_ PROCEDURE and any command file.
Example
The following loads and executes the nu/TPU debug file my.bug during the editor startup process.
UNIX/DOS: tpu -debug=my.bug my.tpu
VMS: edit/tpu /debug=my.bug my.tpu
There is no GET_INFO call to extract debug command line status.
DISPLAY (DISPLAY default)
UNIX/DOS: -[NO]DISPLAY
VMS: /[NO]DISPLAY
The DISPLAY switch determines whether nu/TPU will make use of the screen
management facility and keyboard. By default, nu/TPU sessions will display the edit
session to the screen and accept input from the keyboard.
The /NODISPLAY switch is convenient for developing nu/TPU code for batch
processing. nu/TPU update streams can run stand-alone or as part of a batch process.
Error messages will be generated if screen or window manage- ment built-ins
are called when using nodisplay mode. For example, an si initialization file using si screen management commands will generate errors and bypass the screen
commands.
nu/TPU batch processes must be self-contained edit sessions providing control
over both startup and exit processes.
Example
Run an update stream with no screen I/O.
UNIX/DOS: tpu -nodisplay -nosection -command=custom.tpu
VMS: tpu /nodisplay /nosection /command=custom.tpu
!GET_INFO call to extract display status for conditional processing.
IF GET_INFO (COMMAND_LINE, ‘display’) THEN
UPDATE (current_window);
ENDIF;
ENVIRONMENT (ENVIRONMENT off default)
VMS No equivalent
UNIX/DOS -ENVIRONMENT
The ENVIRONMENT switch shows the settings for the current command switches and
then exits the session. An editing interface cannot be run when the
/ENVIRONMENT switch is specified. The switch values displayed are the result of the
environment variables, defaults file settings, and any switch values defined on the
command line. The command line values always supersede the defaults file
settings.
Example
Examine the settings from the active defaults files.
UNIX/DOS: tpu -environment
HELP (HELP off default)
UNIX/DOS: -HELP
The HELP command line switch provides an on-line listing of the command line
switches and the required syntax. If a command line contains an invalid switch
or invalid syntax, nu/TPU will perform as if the HELP switch was issued. After
the command list is provided, nu/TPU will exit back to the operating system
command line.
Example
Display the command line options on the screen.
UNIX/DOS: tpu -help
INITIALIZATION (si_init.si default)
UNIX/DOS: -[NO]INITIALIZATION[=file_name]
VMS: /[NO]INITIALIZATION[=file_name]
The INITIALIZATION switch determines whether a file containing interface
commands is processed at startup. Initialization files are used to automate the
startup configuration processes for your editing sessions.
By default, when a nu/TPU session is started, it will search for the interface
defaults initialization file. For example, when the si interface is run, nu/TPU automatically searches for the si_init.si initialization file in the current directory. If the EVE interface si.sec
section file is being used, nu/TPU will search for eve_init.eve. If a file specification is provided with the /INITIALIZATION switch, the
defaults file is skipped. If the initialization file is not found, a warning
message is generated and the edit session continues normally.
Example
Edit program.c after processing the initialization file named myedit.int.
UNIX/DOS: tpu -init=myedit.int program.c
! GET_INFO command to extract the initialization filename.
IF GET_INFO (COMMAND_LINE, ‘initialization’) THEN
init_file := GET_INFO (COMMAND_LINE, ‘initialization_file’);
ENDIF;
JOURNAL (JOURNAL default)
UNIX/DOS: -[NO]JOURNAL[=file_name]
VMS: /[NO]JOURNAL[=file_name]
The JOURNAL switch is used to determine whether the editing session will be
started with keystroke journaling turned on. Creating a journal file provides a
means to replay the edit keystrokes from the edit session in case of abnormal
termination.
By default, nu/TPU edit sessions will create a journal file with the filename 11223344.tjl. The numeric portion of the filename is the system hour, minute, second and
millisecond time when the journal file is created. The default filename may be
overridden by providing journal file specifications with the JOURNAL switch. The
journal file is created in the current directory unless a directory path is
provided as part of the journal filename. Keystroke journaling is turned off with
the NOJOURNAL switch.
Keystrokes are buffered to reduce disk I/O overhead. The size of the buffer is
determined by the SET (JOURNALING) built-in. The JOURNALING value may range
from 1 to 10. nu/TPU multiplies the value by 50 to determine the number of
keystrokes to buffer. The default is 500 keystrokes, therefore JOURNALING is set to
10. To modify the journaling rate, see the SET (JOURNALING) built-in.
Example
The following edit session will use the default journal file process. The
journal file will a name based on the current data and time.
DOS/UNIX/VMS: tpu myfile.txt
Edit file123.dat with a journal file named lastedit.jou placed in the directory /usr/tmp.
UNIX/DOS: tpu -journal=/usr/tmp/lastedit.jou file123.dat
VMS: edit/tpu /journal=[usr.tmp]lastedit.jou file123.dat
! GET_INFO command to issue a message on the journaling status and set the
journaling rate to the minimum.
IF GET_INFO (COMMAND_LINE, ‘journal’) THEN
j_name := GET_INFO (COMMAND_LINE, ‘journal_file’);
SET (JOURNALING, 1);
MESSAGE (FAO (“Journaling to: !AS”, j_name ));
ELSE
MESSAGE (“Journaling is not active”);
ENDIF;
MODIFY (MODIFY default)
UNIX/DOS: -[NO]MODIFY
VMS: /[NO]MODIFY
The MODIFY switch determines if the initial user buffers created for the edit
session can be modified. It only controls the ability to update the initial
user buffers created during the edit session. The editing interface is responsible
for controlling the ability to modify additional buffers.
The ability to modify the buffers can also be affected by the READ_ ONLY
switch. The READ_ONLY switch will affect the buffer modify status only if the MODIFY
switch is not specified on the command line. Specifying /READ_ONLY will
prohibit changes to the buffer.
By default, the si interface makes all user buffers modifiable.
Example
Start the si editor with a READ_ONLY buffer.
UNIX/DOS: tpu -nomodify myfile.txt
VMS: edit/tpu /nomodify myfile.txt
UNIX/DOS: tpu -read_only myfile.txt
VMS: edit/tpu /read_only myfile.txt
! GET_INFO command to set the MODIFY switch value to a new buffer.
newbuf := create_buffer (“newbuf”);
IF GET_INFO (COMMAND_LINE, ‘nomodify’) THEN
SET (MODIFIABLE, newbuf, off);
ENDIF;
OUTPUT (OUTPUT=input_file.nam default)
UNIX/DOS: -[NO]OUTPUT[=filename]
VMS: /[NO]OUTPUT[=filename]
The OUTPUT switch determines whether the initial user buffer can be written to
a file and the filename it is written to. It will only affect the main buffer.
The editing interface must control the assignment of output filenames and the
output status of subsequent buffers.
The filename provided with the /OUTPUT switch determines the name of the file
that is created or updated when the contents of the main buffer are written.
This provides an easy means for editing a file and preserving its contents by
writing the buffer to a secondary file.
If no OUTPUT switch specification is provided, si will assign the buffer input filename to the output filename. Output
filenames can be subsequently modified during the edit session with the nu/TPU SET
command.
Example
Save the contents of myfile.dat by writing the changes to revised.txt in the current directory.
UNIX/DOS: tpu -output=revised.txt myfile.dat
VMS: edit/tpu /output=revised.txt myfile.dat
!GET_INFO command to extend output switch specifications.
IF GET_INFO (COMMAND_LINE, ‘output’) THEN
new_file := GET_INFO (COMMAND_LINE, ‘output_file’);
ENDIF;
READ_ONLY (NOREAD_ONLY default)
UNIX/DOS: -[NO]READ_ONLY
VMS: /[NO]READ_ONLY
The READ_ONLY switch determines if the contents of the main buffer are used to
create a file if the buffer has been modified. If READ_ ONLY is specified at
the command line, the modified contents of the first buffer cannot be written to
disk.
Using the READ_ONLY qualifier with si has the same effect as using the NOJOURNALING, NOMODIFY, and NOOUTPUT switches.
Example
Use the login file as read only.
UNIX/DOS: tpu -read_only login
VMS: edit/tpu /read_only login
! GET_INFO call to assign the READ_ONLY switch value to a new buffer.
newbuf := CREATE_BUFFER (“newbuf”);
IF GET_INFO (COMMAND_LINE, ‘read_only’) THEN
SET (MODIFIABLE, newbuf, OFF);
ENDIF;
RECOVER (NORECOVER default)
UNIX/DOS: -[NO]RECOVER[=file_name]
VMS: /[NO]RECOVER[=file_name]
The RECOVER switch determines whether nu/TPU will process keystrokes from a
journal file at the beginning of the editing session. Successful termination
automatically deletes open journal files.
It is very important that all files used during the editing session be
restored to their original state before recovering with a journal file. If the file
contents have changed, using the journal file may not yield the desired results.
It is also important that the editing environment be duplicated. The window
size, tabs settings, margins, and other settings that affect interface commands
must be duplicated to the settings of the original edit session.
Example
Replay the keystrokes from the journal file myfile.tjl prior to editing myfile.txt.
UNIX/DOS: tpu -recover = myfile.txt
VMS: edit/tpu /recover = myfile.txt
! GET_INFO command to ask for continuation after recover process is complete.
IF GET_INFO (COMMAND_LINE, ‘recover’) THEN
response := READ_LINE (“Recover complete, Exit ‘Yes’ ‘No’:, 3");
ENDIF;
SECTION (si.ini default)
UNIX/DOS: -[NO]SECTION=section_file
VMS: /[NO]SECTION=section_file
The SECTION file switch determines whether or not a section file’s definitions
are loaded. Either a section or a command file is required to start up nu/TPU.
Because a section file is precompiled and stored in binary form, it provides
the fastest means for loading interface definitions.
Only files created with the built-in procedure SAVE can be used with the
SECTION switch. Section files are normally located in the nu_tpu/ common directory.
The default section file is si.ini from the TPU_HOME/ nu_tpu/common directory.
The NOSECTION switch stops the looking up and processing of any section file.
Example
Default startup uses the section file si.ini to edit the file sample.txt.
UNIX/DOS: tpu sample.txt
Use section file./extended.ini , located in the current working directory, and a command file from the nu_tpu/common directory to edit text.1.
DOS: tpu /section=.\extended.ini /command=my.cmd text.1
UNIX: tpu -section=./extended.ini -command=my.cmd text.1
VMS: edit/tpu /section=[]extended.ini /command=my.cmd text.1
To build a new editing interface from scratch, use the /NOSECTION switch along
with a command file to build the new editor.
UNIX/DOS: tpu -nosection -command=interface.tpu
VMS: edit/tpu /nosection /command=interface.tpu
! GET_INFO command to extract section filename.
IF GET_INFO (COMMAND_LINE, ‘section’) THEN
MESSAGE (FAO (‘Using section file: !AS’)
GET_INFO (COMMAND_LINE, ‘section_file’));
ELSE
MESSAGE (“No section file in use”);
ENDIF;
START_POSITION (START_POSITION = 1,1 default)
UNIX/DOS: -START_POSITION=x,x
VMS: /START_POSITION=(x,x)
The START_POSITION switch is used to set the initial location of the cursor in
the main buffer. The starting location is specified by line and character
number. If the location line number is greater than the number of lines in the
buffer, the cursor is placed at the end of the buffer. The default line and
character numbers are 1,1.
Example
Start at line 100, column 1.
UNIX/DOS: tpu -start_position=100,1
VMS: edit/tpu /start_position=(100,1)
! GET_INFO command to extract the START_POSITION parameters.
line_no := GET_INFO (COMMAND_LINE, ‘start_record’);
clmn_no := GET_INFO (COMMAND_LINE, ‘start_character’);
WRITE (WRITE default)
UNIX/DOS: [NO]WRITE
VMS: /[NO]WRITE
The WRITE switch determines whether the main editing buffer will produce an
output file. Since the WRITE switch only affects the main buffer, the editing
interface must control the assignment of the write status for subsequent buffers.
With the si interface, using the NOWRITE switch is the same as specifying NOMODIFY,
NOOUTPUT, and NOJOURNAL.
By using the /NOWRITE switch, the main buffer may not be altered.
Example
Using the NOWRITE switch prohibits the contents of test.code to be written.
UNIX/DOS: tpu -nowrite test.code
VMS: edit/tpu /nowrite test.code
! GET_INFO call to assign the WRITE switch value to a new buffer.
newbuf := CREATE_BUFFER (“newbuf”);
IF GET_INFO (COMMAND_LINE, ‘write’) THEN
SET (NOWRITE, newbuf, OFF);
ELSE
SET (NOWRITE, newbuf, ON);
ENDIF;
X Command Line Switches
nu/TPU understands the following X command line options.
Switch Values
-geometry COLUMNS x ROWS [{+-} hoizontal {+-} vertical]
-title “string”
-cursor_fg Defined colors
-font Defined fonts
-fontList Defined fonts for buttons and labels
-background Defined colors
-foreground Defined colors
-xrm Resource string (For a list of the resources and syntax needed, see the
Xnu_tpu file in /usr/lib/X11/app-defaults directory.)
User Options