diff --git a/doc/src/start/bin.md b/doc/src/start/bin.md index 9e180a37..a053315d 100644 --- a/doc/src/start/bin.md +++ b/doc/src/start/bin.md @@ -10,8 +10,43 @@ A number of Rhai-driven utility programs can be found in the `src/bin` directory | [`rhai-repl`]({{repoTree}}/examples/rhai-repl.rs) | a simple REPL, interactively evaluate statements from stdin | | [`rhai-run`]({{repoTree}}/examples/rhai-run.rs) | runs each filename passed to it as a Rhai script | -`rhai-repl` is particularly useful – it allows one to interactively try out Rhai's -language features in a standard REPL (**R**ead-**E**val-**P**rint **L**oop). + +`rhai-repl` – The Rhai REPL Tool +------------------------------------- + +`rhai-repl` is a particularly useful utility program – it allows one to interactively +try out Rhai's language features in a standard REPL (**R**ead-**E**val-**P**rint **L**oop). + +Filenames passed to it as command line arguments are run and loaded before the REPL starts. + +### Example + +The following command first runs three scripts – `init1.rhai`, `init2.rhai` and +`init3.rhai` – loading the functions defined in each script into the _global_ +namespace. + +Then it enters an REPL, which can call the above functions freely. + +```bash +rhai-repl init1.rhai init2.rhai init3.rhai +``` + + +`rhai-run` – The Rhai Runner +--------------------------------- + +Use `rhai-run` to run Rhai scripts. + +Filenames passed to it as command line arguments are run in sequence. + +### Example + +The following command runs the scripts `script1.rhai`, `script2.rhai` and `script3.rhai` +in order. + +```bash +rhai-run script1.rhai script2.rhai script3.rhai +``` Running a Utility Program