Commit graph

3 commits

Author SHA1 Message Date
Martin Mares bc2fb68098 Parse CLI commands. We use the same parser as for configuration files (because
we want to allow filter and similar complex constructs to be used in commands
and we should avoid code duplication), only with CLI_MARKER token prepended
before the whole input.

Defined macro CF_CLI(cmd, args, help) for defining CLI commands in .Y files.
The first argument specifies the command itself, the remaining two arguments
are copied to the help file (er, will be copied after the help file starts
to exist). This macro automatically creates a skeleton rule for the command,
you only need to append arguments as in:

	CF_CLI(STEAL MONEY, <$>, [[Steal <$> US dollars or equivalent in any other currency]]): NUM {
		cli_msg(0, "%d$ stolen", $3);
	} ;

Also don't forget to reset lexer state between inputs.
1999-10-31 17:47:47 +00:00
Martin Mares b9672a845f The CLI I/O functions work as desired. 1999-10-31 15:43:44 +00:00
Martin Mares 7d3aab1c16 First steps of the Command Line Interface: I/O routines. 1999-10-29 12:10:10 +00:00