Reference · Cube engine and views
runClifunction
The whole command line. args are the arguments after the command's name;
the result is the exit code and the text for each stream. Exit code 0 is
done, 1 is something asked for that could not be done (turns the cube cannot
make, a cube that is not solved under --verify), and 2 is a command that
was itself wrong.
Import it
import { runCli } from "@johnmorrisdotca/kyuubu";
Definition
function runCli(args: readonly string[], surroundings?: CliSurroundings): CliResult
Parameters
| Name | Type | Description |
|---|---|---|
args | readonly string[] | Arguments after the command name. |
surroundings (optional) | CliSurroundings | Host-provided environment, input, locale and random source. |
Returns
CliResult
The whole command line. args are the arguments after the command's name; the result is the exit code and the text for each stream. Exit code 0 is done, 1 is something asked for that could not be done (turns the cube cannot make, a cube that is not solved under --verify), and 2 is a command that was itself wrong.
Examples
import { runCli } from "@johnmorrisdotca/kyuubu";
console.log(runCli(["--size", "2", "--verify", "--from", "R", "R'"], { colour: false }));{ code: 0, out: 'Solved. Moves: 1\n', err: '' }What it prints (run when this page was built)