Like most command-line programs, lr accepts various options. These control
things such as the language that Libero generates, the filenames it uses,
etc.
You can supply an option in various ways:
- Type the option when you run lr. This is good for options that you use
now and then.
- Place the option in the dialog file itself (at the start of the file,
anywhere before the first state). This is good for options that are specific
to that dialog file.
- Place the option in a global initialisation file, usually called lr.ini,
somewhere on the path. This is good for options that you want for all your
work.
It sometimes gets a little complex to remember which option is active,
especially if you put the same option in various places. For instance you
could put '-nocheck' in lr.ini, then run the lr command with the '
check' option. Which takes precedence? The answer is: it works like it
should. This is a somewhat arrogant statement, so I'll explain:
- Each option has a default value, as explained below. When Libero starts
up, this is the value.
- Libero reads the lr.ini file and uses the options in that file.
These can change the default values.
- Libero then looks at any options in the dialog file.
- Libero looks at the lr command line and processes any options you typed
there. Libero picks-up a -help option right away, as well as a -initial or
-path, since these affect which lr.ini file it reads.
If you are unsure of the options in effect for your dialog, run
lr with the -settings option. This displays the current options.
You can specify a Libero option in various forms:
- -option
- Normal usage.
- -option=value
- Option takes value.
- -option:value
- Also okay.
- -option="value"
- Don't convert value to lowercase.
- -option:'value'
- The same as above.
- -nooption
- switch off true/false option.
- -option=no
- -option=false
- The same as above.
You can abbreviate an option name to 3 or more characters.
Option values are converted to lower-case unless you place them
in single or double quotes. Some options take values; others are
true/false options. These is a summary of the options that lr
accepts:
Option Explanation Default
-animate include animation code -noanimate
-author=name include animation code ="My Name"
-check generate full runtime checks -check
-compress compress generated tables -compress
-defaults=state name of defaults state =defaults
-dpath=variable path for dialog and ini files ="PATH"
-generate generate output code -generate
-help show this information -nohelp
-idle indicate idle modules -noidle
-initial=file read options from file =lr.ini
-option=list define generation options none
-path=variable path variable for schema files ="PATH"
-plusd enforce 'source+D' naming rule -noplusd
-pretty pretty-print dialog file -nopretty
-schema=file schema for code generation =lrschema.c
-settings show option settings per file -nosettings
-sort add module stubs alphabetically -sort
-source=file program for dialog name of dialog
-stats show dialog statistics -nostubs
-stubs generate stubs for new modules -stubs
-style=plain naming style: some_module_name -style=plain
-style=caps naming style: SomeModuleName
-style=headline naming style: Some_Module_Name
-style=title naming style: Some_module_name
-style=normal naming style: Some-Module-Name
-style=cobol naming style: SOME-MODULE-NAME
-trace trace code generation to list file
And now in detail:
- -[no]animate - include or exclude animation code. If
you use this option, the schema will generate code that displays
each new state, event, and action as the dialog runs. This is
useful for debugging. The default is -noanimate.
- -author - Libero uses this value when it creates a
new file for you. Put the string in quotes to include spaces:
-author='My Name'. On the MS-DOS command line, you must type
this (two sets of quotes): "-author='My name'". The default is
"Your Name".
- -[no]check - generate full runtime checks. If you
use this option, the schema will generate code that checks for
invalid or missing events while the program runs. Keep this
option unless you are sure it is slowing down a crucial dialog.
The default is -check.
- -[no]compress - compress the generated tables.
Currently, this means:removing unused states. You can disable
this using the nocompress option. The default is
-compress.
- -defaults=state - the name of the Defaults state.
This state serves to collect events that can happen in any other
state; you can make the dialog smaller and simpler by placing
these into the Defaults state. The default is "Defaults".
- -dpath=variable - Libero uses this path to search for
the lr.ini file and the dialog file. You can use the name of an
environment variable (a logical variable under VMS) or a literal
path. If the case is important, enclose it in quotes. For
example, under MS-DOS: -dpath='LRPATH'. Libero always searches
the current directory first. The default is empty, in which
case Libero uses the -path value.
- -[no]generate - generate output code. If you want to
check the dialog but not generate any output, use -nogen. The
default is -generate.
- -[no]idle - indicate idle modules. Libero lists any
modules in your program that are not referenced in the dialog.
This can happen when you change a dialog. The default is
-noidle.
- -initial=file - tells Libero to read options from
some specific file instead of lr.ini. You can use this option
on the command line only. The default is "lr.ini".
- -option:name=value - supply a specific option value
to a schema. This allows the schema to generate code
conditionally, or fill-in specific values. The 'name' is a
variable defined in the schema; the 'value' overrides any
default that the schema specifies. The 'value' can be a full
expression, including references to other schema variables.
- -path=name - Libero uses this path to search for its
message file and the schema used to generate code. You can use
the name of an environment variable (a logical variable under
VMS) or a literal path. If the case is important, enclose it in
quotes. For example, under MS-DOS: -path='LRPATH'. Libero
always searches the current directory first. The default is
"PATH" (in uppercase). See also -dpath.
- -[no]plusd - enforce the "source+D" naming rule. The
default is -noplusd.
- -[no]pretty - rewrite the dialog, aligning it using
the standard Libero conventions. This can work nicely. Your
original dialog is saved with the extension .bak. Does not
generate any code. The default is -nopretty.
- -schema=file - schema for code generation. If you
override this default, be sure to specify the file extension.
The default is "lrschema.c".
- -[no]settings - show option settings for each file
processed. The default is -nosettings.
- -[no]sort - output new module stubs in sorted order.
Depending on your preferences, you may want to keep modules in
sorted order or natural order. The default is -nosort.
- -source=file - program that uses the dialog. By
default the name of the dialog, unless you use -plusd option, in
which case it is the name of the dialog minus an obligatory
'D'.
- -[no]stats - report the number of states, events, and
modules in the dialog. The default is -nostats.
- -[no]stubs - generate stubs for modules which are
referenced in the dialog but do not (yet) exist in the program.
The default value for this option is -stubs. If you use
-nostubs, you will have to make new module stubs by hand. So
leave -stubs on.
- -style={plain|caps|heading|title|normal|cobol} -
style for module and event names. The default is 'plain'. You
can use this to adapt Libero's output to your preferred
programming style; do not change halfway through a project
unless you like doing major cleanups.
- -[no]trace - create a report file that traces the
code generator's output. This is useful if you are writing or
changing a schema, and cannot get it to work. The trace file is
called dialog.lst. The default is -notrace.