14. Command-line options
Prev |  | Next

## 14. Command-line options

### 14.1. Synopsis

tred [-q] [-c <config-file>] [-m|-I <macro-file>] [-t context]
[-l <filelist>] [-n encoding] [other-options] [file[##N|##N.M|#ID] ...]

or

tred -C <command>

or

tred -u for usage
tred -h for help
tred --man for the manual page
tred --version for version

### 14.2. Filename arguments

Each filename on the command-line or in a file list may be optionally followed by a suffix which identifies a node to be selected when the file is opened. The suffix can be of one of the following following forms:

#ID where ID is an identifier of a node (for file formats that have identifiers, e.g. PML).

##N where N is a number. This selects the root of the N-th tree

##N.M where N and M are numbers. This selects the M-th node in the depth-first order in the N-th tree.

### 14.3. Options

-C command

  Perform a given command on a running instance of TrEd. Currently only one command is supported:

  open <filename>

  If there is no TrEd instance running, the filename is opened in a new instance.

--filelist|-l filename

  Read a list of filenames to process from a given file (one filename per line). Files specified in a file-list are processed prior to files specified on the command-line. If file-list is a file with .fl extension, then the first line may contain a file-list name (as in TrEd). Moreover, unlike in other file-lists, filenames in .fl file-lists are asssumed to be relative to the file-list file location.

--macro-file|-m filename

  File with macro definitions to load. If no macro-file is given, standard macro file (by default `tred.mac`) is used.

--include-macro-file|-I filename

  A file containing additional set of macros to load. This option is typically used instead of `--macro-file` to allow loading macros both from `filename` and the default macro set (`tred.mac`). `--macro-file` can still be used in combination with --include-macro-file to supply a replacement for `tred.mac`.

--config-file|-c filename

  TrEd configuration file (overrides ~/.tredrc).

--option|-O name=value

  Override configuration option from the config file with a given value. This flag can be used several times for different options.

  Special syntax of the name part allows some modifications of existing option values for options that are delimited lists (this cannot be used to modify default or implicit values):

  nameX=value

    Treat the option as a list delimited by the delimiter X and prepend the value to the list.

  nameX+=value

    Treat the option as a list delimited by the delimiter X and append the value to the list.

  nameX-=value

    Treat the option as a list delimited by the delimiter X and remove the value from the list (if exists).

  Only the following characters can be used as a delimiter:

  ; : , & | / + - \s \t SPACE

  where SPACE is a space character, \s matches arbitrary white-space, and \t matches TAB character.

  The options can be combined; for example

  -O "extensionRepos\\s"-=http://foo/bar -O "extensionRepos\\s"+=http://foo/bar

  first removes any occurrence of the URL http://foo/bar from the white-space separated list of extensionRepos and then appends the URL to the end of the list.

--stylesheet-file path

  Path may be either a file name, in which case it must point to a TrEd stylesheet configuration file in the old format or ~/.tred-stylesheets (obsolete), or a directory, in which case each file in the directory must be a TrEd stylesheet.

--resource-dir|-Z dirnames

  Specifies resource path. This option can be repeated and overrides ResoucePath setting in the TrEd configuration file.

  Individual paths can also be separated by colon (POSIX/Unix) or semi-colon (Windows) separator. If there is a lone leading or trailing separator, the default resource path is prepended or appended, respectively.

--context|-t context_name

  Initial macro context.

--show-hidden-nodes|-H

  Start in the mode where hidden nodes are displayed.

--stylesheet|-s stylesheet-name

  Initial stylesheet to render the tree according to.

--split-window|-p number

  Split window to given number of subwindows (horizontally if positive, vertically if negative) and open n'th file in n'th subwindow.

--execute|-e perl-code

  Macro code to evaluate just before the main loop is started.

--window-embed|-W window_ID

  Embed main window into window with the given window ID.

--no-geometry|-G

  Do not initially resize window to its last geomtery.

--extra-backends|-B backend

  Comma separated list of user-defined IO-backend modules to load.

--file-encoding|-n encoding

  Allows to specify character encoding of input files (does not apply to XML files).

--define-symbol symbol_name

  Symbol name or a name=value pair to be used by macro-preprocessor (equivalent to a `#define` instruction at the beginning of the macro file). Multiple definitions symbols may be separated by a comma and the option may be repeated.

--no-secondary-files|-Y

  Neither load or save "secondary" files. Normally, secondary files (if loaded) are saved along with their primary files (the exactly same file-name prefix/suffix processing and format apply to both the primary and secondary files). A secondary file is a file required by a (normal - primary) file to be loaded along with it; this is typical for files containing some form of a stand-off annotation where one tree is built upon another. Note however, that this does not include so called knitting - an operation where the stand-off annotation is handled by a IO backend and the resulting knitted file appears to btred as a single unit.

--enable-extensions|-j list

  Give a comma-separated list of installed TrEd extension names to temporarily enable if disabled in the extension configuration. Use '*' to enable all currently enabled extensions.

--disable-extensions|-J list

  Give a comma-separated list of installed TrEd extension names to temporarily disable if enabled in the extension configuration. Use '*' to disable all currently enabled extensions.

--tectogrammatical-trees|-R

  Build tectogrammatic trees from CSTS files.

--csts-tree-attributes|-X gov,ord?,hide?

  CSTS format is "many in one"; there may be more tree structures in one file. This option can be used to specify which tree structure should be used. Provide a comma separated list consisting of names of node atributes corresponding to CSTS elements that contain the necessary information to build a tree out of a CSTS file. The first attribute should be an attribute containing the index of the governing node; the second one is optional and specifies the ordering attribute; the third one is also optional and if specified, it should be the attribute used to mark hidden nodes with the string 'hide'. If the third argument is specified as empty (i.e. there is a trailing comma), default to 'X_hide' with preset-value 'hide'.

  Examples: -X govTR,dord - corresponds to elements <TRg> and <tfr> in CSTS

  -X govMD_c,ord,x_MD_c_hide
  - corresponds to <MDg src="c">, <r>,
  and <x name="MD_c_hide">).

--no-backups

  Do not generate `tilda' backup files.

--no-locks

  Do not attempt to create lock files. Lock files are used to prevent another TrEd instance/user from modifying the same document.

--autosave number

  Create an auto-save file for each modified document every given number of minutes. If 0, auto-saving is disabled.

--quiet|-q

  Print only general processing information on stderr.

--debugging|-D

  Print a lot of debugging information on the stderr.

--carp

  Replace 'die' with 'Carp::confess', so that a complete stack trace is printed upon error. Useful for debugging.

--version|-v

  Print version and quit.

--man|-m

  Displays the help as manual page.

--help|-h

  Prints the help page and exits.

--usage|-u

  Print a brief help message on usage and exits.

Prev |  | Next
13. Configuration and customization | Home | ToC | 15. User Macros