Next: , Previous: , Up: Top   [Contents][Index]

2 Invoking m0

2.1 Introduction

The format for calling m0 is following the "default" GNU and posix rules:

m0 [option] [file]

The ordering of options is not relevant unless the -O / --ordered-options is set. The files are processed in order of placement on the command line.

2.2 Command line options

-?
--help

Print a help summary on standard output, then immediately exit m0 without reading any input files or performing any other actions.

--usage

Print a short usage on standard output, then immediately exit m0 without reading any input files or performing any other actions.

-D name[=value]
--define=name[=value]

This enters name into the macro name table. If ‘=value’ is missing, the value is taken to be the empty string. The value can be any string, but the macro can not be defined to take arguments. The order with respect to file names is not significant in contrast to some other macro processors.

-E
--fatal-warnings

Controls the effect of warnings.

By default no warnings are printed and execution continues when errors are detected.

If specified:

-o file
--output=file

Specifies the file to use for output. The default output, when no output file is specified, is standard output.

-O
--ordered-options

After setting this option, the options on the command line are valid for succeeding files. This is valid for the options: -D, -E, -o, -T and -t.

The options set for the succeeding file are based on the defaults and options set before the -O option and the options set directly before the file.

The -o and -t options to set an output or a trace file are persistent. This means that these files are only changed when set and are not automatically reset to the default. The setting of these files opens a new file. They will not append to an existing or previously set file.

The -D option, which defines a macro, is also persistent and therefore this definition also exists in later files.

-s
--statistics

Print statistics of the use of macros, macro sets, patterns and internal memories at the end of running the program. This is output to standard output.

Can be used as a source for debugging of macros.

-T
--traceon

Set tracing of macros on. Information of the called macros is output to standard output or to a file.

-t file
--tracefile=file

Specifies the file to output trace information to.

-V
--version

Print the version number of the program on standard output, then immediately exit m0 without reading any input files or performing any other actions.

2.3 Specifying input files on the command line

Multiple input files can be specified on the command line. The files are read in the order in which they are placed on the command line. If no file is specified the standard input is taken as input.

A - specifies standard input as input. This - can appear multiple times and will also open the standard input multiple times. The control-D normally ends the input from standard input in a console.

The position of options compared to the position of the files makes no difference, unless the -O / --ordered-options is set. Files placed after -- are also used as input files and are not transferred to the argument string for use in the macro processor.

2.4 Specifying options for emulation

Options after a -- are not processed as options to m0 (files are however necessarily processed by the m0 program).

These options are put in a string that can be output by a macro function. This string can be used to set options in an emulation package of another macro processor. Important options might be the definition of macros on the command line or syntax options.

It is however the emulation package that is responsible to process these options. In the m0 program nothing is set depending on these options. It would also be difficult to let the m0 program process these options, because these options should be known already before the emulation code runs.


Next: , Previous: , Up: Top   [Contents][Index]