Command Line Switches

Euphoria provides several products: interpreter, shrouder, binder, and compiler. Euphoria is easy to use because you only need the filename when launching any product on the command line. To interpret a program type: eui hello. To compile a program type: euc hello.

You can add optional switches to customize how a product will behave; switch is the shortened form of command line switch. A switch may be typed directly at the command line or read from a file.

For example, the Euphoria interpreter (eui) could be launched in a variety of ways:

Command Line Product launched using... Comments
eui Product only Test if Euphoria is installed.
Euphoria Interpreter v4.0.5
Linux, Using System Memory
Revision Date: 2013-00-00, Id: 62d9455
ERROR: Must specify the file
to be interpreted on the command line
eui -copyright One Switch Copyrights are displayed.
eui hello Filename Typical usage;
file extension is optional.
eui hello.ex fido Filename and Argument Program can read text "fido."
eui -strict hello.ex Switch and Filename All warning messages are enabled.
eui hello.ex Local eu.cfg file
All warning messages are enabled.

Command Line Syntax

Railway style:


BNF style:

  1. Product ==: eui | euiw | eub | eushroud | eubind | euc
  2. Switch ==: (-name ) | (--synonym )
  3. Switch_List ==: Switch [Switch_List]
  4. Extension ==: [ ex | exw | exu | user_selected ]
  5. Filename ==: filename [ (.)|(.)Extension ]
  6. Argument ==: string [Argument]
  7. Launch ==: Product [ Switch_List ] [ Filename ] [ Argument ]
  1. To display the valid switches for any product use the "help switch" (-h or --help ).
    For example: eui --help .
    See also: supported command line switches.

  2. A few switches have a long name synonym which is selecting using double dashes. Switches are optional. Switches are separated by blanks.

  3. Switches are gathered from several locations and are formed into a switch list. A location provides a source of switches; possible locations include: eu.cfg files, user specified files, and the command line. There is a standard order for reading locations: see windows order or see unix order.

    Each location contributes to a stack from which the switch list is formed. Note that switches from the default eu.cfg file are included, even if the command line is blank. Not all switches that are gathered end up in the final switch list. See also: switch properties.

  4. Euphoria is flexible about file extensions; a file extension is not mandatory, default extensions (.ex .exw .exu) may be left off, and any user defined extension is permitted.

  5. Only the filename is needed to interpret or compile a program.

  6. A user can enter a list of strings (separated by blanks) that are read by the command_line function.

  7. If no switches are entered on the command line, switches from the eu.cfg file are still added to the switch list.

Configuration File Format

A configuration file is a text file providing command line switches to the switch_list. Each line contains one item: a comment, a section header, a switch, or path.

The default file name for a configuration file is eu.cfg . The -c filename switch lets the user select any name and extension for a configuration file.

  • A comment line that begins with a double dash, --, and continues to the end of the line; comment lines are ignored.

  • A section header is a name delimited by brackets: [name] . The following section headers are permitted:

    [interpret], [interpret:windows], [interpret:unix], [bind], [bind:windows], [bind:unix], [translate], [translate:windows], [translate:unix], [windows], [unix], [all] .

    The first lines of a file, before any section header, are assumed to belong to the [all] section.

    A Euphoria mode is the combination of product and operating system. If the mode matches a section header, then command line switches in that section will added to the switch_list. If the mode does not match a section header, then the command line switches in that section are ignored. There can be any number of section headers.

  • A switch is a line beginning with a single dash ( - ) and includes everything on that line. If the mode matches the section header the switch is added to the switch_list.

  • A path is the argument to the -i switch. There is a shortcut that identifies any line that is not a comment, section header, or switch to be a path. The shortcut appends the path to the text -i and presents the complete switch to the switch_list. You can ignore the shortcut and write the -i prefix explicitly before any path.

Forming a Switch_List

Configuration File Reading Order

Every configuration file is read in a standard order, and then the command line is read.

Note that the -c filename switch reads a configuration file immediately and nests the gathered switches into the switch_list. Each configuration file is read only once; repeated references to the same configuration file are ignored (this prevents an infinite loop of file reading).

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu