13. Command-line options

The general usage is as follows:

tred [-q] [ -R | -X gov,ord ] [-G] [-Y] [-H] [-c config-file] [-m macro-file] [-t context] [-s stylesheet] [-n FS-file-encoding] [-p number-of-views] [-B backends] [-l file-list] [-W window-id] [ file | file##N | file##N.M ...]

or

tred [ -u | -h ]

to obtain short instructions on usage (-u) or a brief help (-h).

The optional command-line parameters have the following meaning:

-m

This parameter may be used to force TrEd to use a different macro file from that given in TrEd's configuration file.

-c

This parameter may be used to force TrEd to use a certain configuration file.

-t

Prefer the given binding context as the initial context for every opened file. This context may be however overriden by some hooks such as start_hook or file_opened_hook.

-s

Use given stylesheet as the initial stylesheet for every view.

-n

Allows to specify character encoding for the FS backend (unlike e.g. XML files, FS files provide no means to determine their character encoding).

-p

A positive (or negative) integer value specifying the initial number of vertical (or horizontal) views. If this option is used, TrEd automatically splits the window into that many views and displays the n'th file on the command-line in the n'th view (for n up to the number of views). If no files were specified on the command-line, but -l was used, then n'th view is associated with n'th file-list specified in -l.

-l

This parameter may contain a comma-separated list of files each containing one or more file-names (one per line). TrEd reads these files and creates file-lists named CmdLine-1, CmdLine-2, etc. correspondingly. Note that you may use - notation for the standard input, e.g. if called with tred -l-, TrEd will expect file-names for CmdLine-1 on the standard input. See also Section 11, “Using File-Lists”.

-q

Request quiet operation, with as little output from tred, as possible.

-W

Under X Window System, embed TrEd's main window into the window with given window-id.

-B

Comma separated list of additional I/O backends to import.

-G

Do not resize TrEd's main window to its last saved geomtery on startup (this option is useful when using -W to embed TrEd into other applications).

-Y

Do not pre-load so called secondary files, i.e. files with additional trees requested by main files (i.e. the files opened by the user). This doesn't apply to external resources loaded directly by I/O backends.

-R

This option is specific to the CSTS backend. When parsing CSTS files, try to restore structure from <TRg> tags rather than from <g>.

-X gov,ord

This option is specific to the CSTS backend. When parsing CSTS files, try to restore structure from tags <gov> and <ord> rather then from <g> and <r>.

-h

Prints a brief help and exits.

-u

Prints a short help on usage and exits.

All other arguments passed to TrEd on the command line are treated as file-names. Unless -p was used, TrEd opens the first of the files and the user may navigate to the next file and back using the File->Next File and File->Previous File menu commands.)

Every file-name either on the command-line or in a file-list may be followed by a suffix specifying a particular tree or node in the file. This node is activated when TrEd opens the file (if no suffix is given then the root node of the first tree in the file is activated). TrEd recognizes the following suffix forms:

##N

where N is a positive integer number. This suffix specifies the root of the N'th tree in the file.

##N.M

where N is a positive integer number and M is a non-negative integer number. This suffix specifies the M'th node of the N'th tree in the file. The ordering of nodes M refers to is the ordering of the deep-first traversal.