Command line arguments:

heromesh [<switches>] <basename> [<resources>]

Where <switches> is the switches, <basename> is the puzzle set base
name (excluding extensions; a puzzle set consists of four files),
and <resources> is optional resources to override.


=== Switches ===

-C
  Dump all class data.

-H
  Dump the hash table.

-L
  Display all tokens being read from the class definition file.

-M
  Write details of macro expansion to stdout.

-O
  Write a solution Hamster archive with private solutions to stdout.

-T
  Mode for testing some internal functions of Free Hero Mesh and SDL. You
  probably do not need to use this mode yourself.

-U
  Enable unstable/experimental features. These features may change in
  future and may later be made not needing this switch; but for now you
  should not use them except for testing and development of Free Hero Mesh.

-a
  Autotest levels, ensuring that the provided solution is valid. Lines
  that don't match /^Level [0-9]+\.*: OK$/ denote errors.

-c
  Only load classes and then terminate. This can be used to test that
  the class definition file does not contain syntax errors, or it can be
  used together with -C, -H, -L, -M to see how it is parsing it.

-e
  Start in the editor instead of game.

-f
  Only flush the user cache and then terminate.

-h
  Disable portable mode; always use the HOME environment variable to find
  the configuration and database files.

-i
  Batch import levels. Accepts the level import format (see export.doc)
  from stdin. It will not overwrite existing levels unless the existing
  level is blank, in which case it will overwrite it.

-n
  Create a new puzzle set. The .xclass and .class files should already
  exist; the .level and .solution files should not already exist, and will
  be created with minimal data.

-p
  Start the picture editor.

-r
  Open in read-only mode.

-t
  Enable tracing.

-v
  More verbose error logging.

-x
  Do not start the GUI; accept SQL codes to execute from stdin, and write
  the results to stdout. See sql.doc for the fuunctions and tables that
  may be used. Dot commands are also possible; see the below section.

-z
  Load a composite puzzle set. In this case, the <basename> should be the
  full file name of the puzzle, including the suffix.

-+
  Load the level whose ID number is specified by the "level" resource.


=== Dot commands ===

.b0
  Disable terminate on errors.

.b1
  Enable terminate on errors.

.f
  Flush the database cache and release memory.

.i
  Tell you the filename of the database.

.q
  Quit.

.u
  Flush the user cache, writing changes to the level and solution files.

.x0
  Disable loading SQLite extensions.

.x1
  Enable loading SQLite extensions.


=== Portable mode ===

Free Hero Mesh may run either in "home mode" or in "portable mode". The
following rules are used to determine which mode to use:

1. If the -h switch is present, use home mode.

2. If the HEROMESH_PREFIX environment variable is present, use portable
mode; its value is the file name prefix (the ".heromeshsession" and
".heromeshrc" names are appended directly to this value, so if it does
not end with a slash, it will be a prefix to the file name too).

3. If argv[0] contains a forward slash, use portable mode; it will use
files "current.heromeshrc" and "current.heromeshsession" in the directory
where the executable file is allegedly found.

4. Otherwise, home mode is used.

