This module contains functions to build a console program, that parses the command line (and a configuration file), divides it into commands, options and non-options, and executes the corresponding action from a tree of available commands.
These commands can be constructed using the module System.Console.Command.
Using a command tree to construct a program
Load the configuration file (if present), and run the command given on the command line. Settings on the command line override the configuration file.
You may use this function, applied to your tree of available commands, as your
Start an interactive session. Arguments to the program are ignored; instead, the user may repeatedly enter a command, possibly with options, which will be executed.
The configuration file is assumed to be in the user's home directory, and to be named ".foobar", where "foobar" is the name of the root of the command tree (usually the name of the program).
Settings in this file are of the form
, see the documentation of the package fez-conf for details. The format of
the "option-value" part depends on the type of the option argument; see
Sections can be defined for settings applying to a single command,
using the name of a command, enclosed in square brackets, as section header: