Reference · Tiles, Mexican Train and replay
runClifunction
Run the command line. See domino --help for what it takes. One seed serves the whole run, so the same command prints the same lines on every machine.
Import it
import { runCli } from "@johnmorrisdotca/domino";
Definition
function runCli(args: readonly string[], around?: CliSurroundings): CliResult
Parameters
| Name | Type | Description |
|---|---|---|
args | readonly string[] | Command-line arguments without the executable name. |
around (optional) | CliSurroundings | Optional environment, input, locale and seed source for the pure CLI. |
Returns
CliResult
Output and error strings with exit code 0 for success, 1 for refused input, or 2 for invalid command usage.
Examples
import { runCli } from "@johnmorrisdotca/domino";
console.log(runCli(["deal","--seed","42","--players","2","--set","9"],{locale:"en-US"}).code);0What it prints (run when this page was built)