contents index next

7. Command-line Options

When Hdrug is started, it first interprets the command-line options. Command-line options are interpreted from left to right. The following section lists the command-line options which are standard. Each application possibly extends this list: this is defined below.

Note that command-line options are interpreted before application-specific initialization is performed. This is to allow command-line options to have an effect on this initialization. Refer to the hook predicate hdrug_initialization for application-specific initialization.

Hdrug applications can extend the list of possible startup options by adding definitions to the multifile predicate option/3. Short usage information for such options can be defined with further definitions for the multifile predicate usage_option/3. An an example, the following definitions ensure that an option -rc File will reconsult the file File:

:- multifile option/3, usage_option/3.
option(rc) --> [File], { reconsult(File) }.
usage_option(rc,"rc File","File is reconsulted.").

7.1. -flag Att Val

Sets global variable Att to Val; Val is read as an atom. Consider using the Flag=Val option if you want to assign arbitrary Prolog terms to Att.

7.2. -iflag Att Val

Sets global variable Att to Val; Val is read as an integer. Equivalent to Flag=Val where Val is an integer.

7.3. -pflag Att Val

Sets prolog_flag(Att) to Val; Val is read as an atom. This is an interface to the SICStus Prolog built-in predicate prolog_flag/3.

7.4. -flag Att Val

Sets global variable Att to Val; Val is read as an atom. Consider using the Flag=Val option if you want to assign arbitrary Prolog terms to Att.

7.5. -cmd Goal

evaluates Prolog Goal; Goal is parsed as Prolog term. Example:

hdrug -notk -cmd 'listing(library_directory)' -quit

7.6. -tk

Indicates that the graphical user interface should be started when hdrug starts. Equivalent to tcltk=on. This is the default.

7.7. -notk

Indicates that the graphical user interface should not be started when hdrug starts. Equivalent to tcltk=off. The default is to start the graphical user interface.

7.8. -dir Dir

This options ensures that Dir is added to the list of library directories.

7.9. -help

This display usage information and terminates.

7.10. -l File

Loads the file File (containing Prolog), using the goal use_module(File).

7.11. -parser Parser on/off

This option indicates that the parser Parser is set to on (off). Parsers which are on will take part in parser comparison runs.

7.12. -generator Generator on/off

This option indicates that the generator Generator is set to on (off). Generators which are on will take part in generator comparison runs.

7.13. -quit

Terminates Hdrug. Useful in combination with the -cmd Goal option.

contents index next