diff --git a/README.md b/README.md index a2cc532..1be0e85 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ Trivial INSTEAD interpreter for developers. -## Build and run +## Build Dependencies: luajit (or lua), iconv. -``` +```bash $ git clone https://github.com/instead-hub/instead-cli.git $ cd instead-cli $ git submodule init @@ -19,9 +19,9 @@ $ ./instead-cli System wide setup: -Edit Makefile.defs. +Edit `Makefile.defs`. -``` +```bash DESTDIR=/ BIN=/usr/local/bin STEADPATH=/usr/local/share/instead-cli/ @@ -29,13 +29,13 @@ STEADPATH=/usr/local/share/instead-cli/ Then: -``` +```bash $ make && sudo make install ``` ### 9front (Plan9) build -``` +```bash % git/clone https://github.com/instead-hub/instead-cli.git % mk init % mk @@ -44,29 +44,101 @@ $ make && sudo make install ## Run +```bash ./instead-cli +``` + +To pass internal command to STEAD use `/` prefix. Some internal commands: + +* `/act 1` (or just `1`) — interact with object in room (if object has `tak` field, it is activated; otherwise, `act` field (if defined) is activated) + + ```bash + $ instead-cli fantasy-game + Room + + The lever(1) on the wall is raised. + + > /act 1 + The lever(1) on the wall is lowered. + + > 1 + The lever(1) on the wall is raised. + + > + ``` + +* `/use 1 2` (or just `1,2`) — use item from inventory on another item of inventory or object in room + + ```bash + $ instead-cli apple-game + Room + + The apple(1) is lying on the floor. The table(2) stands in the + corner. + + > 1 + /I take the apple./ + + The table(1) stands in the corner. + + ** Apple(2) + + > 2,1 + The table(1) stands in the corner. The apple(2) lies on the table. + + > + ``` + +* `/go 1` (or just `1`) + + ```bash + $ instead-cli game/ + Room + + The lever(1) on the wall is raised. + + > + + >> Kitchen(2) + + > /go 2 + Kitchen + + The apple(1) is lying on the floor. The table(2) stands in the + corner. + + > + + >> Room(3) + + > 3 + Room + + The lever(1) on the wall is raised. -To pass internal command to STEAD use '/' prefix. Some internal commands: + >> Kitchen(2) + ``` -* /save filename -* /load filename -* /quit -* /inv -* /look +* `/way` (or just empty line) — return list of ways from current room +* `/inv` (or just empty line) — return items in the inventory +* `/look` — return the description of the current room +* `/save filename` +* `/load filename` +* `/quit` Options: -* -d - debug mode; -* -dfile - debug mode + write stderr to file; -* -wnum - line width is num symbols (70 by default); -* -iscript - read script line by line and use it as commands; -* -lfile - write all input commands to file; -* -cpCODEPAGE - Win only (1251 by default), use 65001 for UTF-8; -* -a - autosave on exit and autoload on start (autosave file); -* -x - execute lua script; -* -e - echo input command; -* -m - enable multimedia output; -* -mcmd - enable run cmd on multimedia. Examples: -m/usr/bin/xdg-open (Linux), -m/bin/plumb (Plan9), -m"start\"\"" (Windows). +* `-d` - debug mode; +* `-dfile` - debug mode + write stderr to file; +* `-wnum` - line width is num symbols (70 by default); +* `-iscript` - read script line by line and use it as commands; +* `-lfile` - write all input commands to file; +* `-cpCODEPAGE` - Win only (1251 by default), use 65001 for UTF-8; +* `-a` - autosave on exit and autoload on start (autosave file); +* `-x` - execute lua script; +* `-e` - echo input command; +* `-m` - enable multimedia output; +* `-mcmd` - enable run cmd on multimedia. Examples: `-m/usr/bin/xdg-open` (Linux), `-m/bin/plumb` (Plan9), `-m"start\"\""` (Windows). ## Links