8. TrEd's command-line options

If running TrEd from the command-line you may use several command-line options and also give TrEd one or more files to open. Each file-name may be also appended number of tree to be displayed by TrEd when the file is opened.

Note

You may need to replace tred with perl tred in the following usage examples in Windows or UNIX, if you cannot set tred the execute permissions.

The general usage is:

tred [-R] [-G] [-c config-file] [-m macro-file] [-t context] [-l file-list] [-W window-id] [-B backends] [file [[##N] | [#N]] ...]

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

Start in the given macro context. This context may be however overriden by some hooks such as start_hook or file_opened_hook.

-l

Use this parameter to pass a file-list to TrEd. Each file-name given in the file-list must be on a separate line. This feature may be particulary useful under Windows, where maximum length of the command-line is usually very limited.

-W

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

-B

Comma separated list of additional input/output 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).

-R

When parsing CSTS files, try to restore structure from <TRg> tags rather than from <g>.

-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 considered file-names to open. (TrEd actually opens only one file at a time, but user may go to the next/previous file 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 given a number suffix which makes TrEd open that file on that tree. There are two possible formats for the suffices:

#N

where N is a number possibly followed by one or more upper-case letters. In this case, #N TrEd searches and displays the first tree in the file the root of which is assigned #N as a value of the attribute form (this feature works only for FS-files of The Prague Dependency Treebank™).

##N

where N is a number. This makes TrEd to display the N'th tree when the given file is opened.