CliResulttype
What the command line came to.
Import it
import type { CliResult } from "@johnmorrisdotca/kotoba/cli";
Definition
type CliResult = {
code: 0 | 1 | 2;
out: string;
err: string;
};
Members
| Name | Type | Description |
|---|---|---|
code | 0 | 1 | 2 | 0 when all went well, 1 when what was asked for is not so or could not be done, 2 when the command itself was wrong. |
out | string | For standard output. |
err | string | For standard error. |
Examples
import type { CliResult } from "@johnmorrisdotca/kotoba/cli";
import { runCli } from "@johnmorrisdotca/kotoba/cli";
const value: CliResult = await runCli(["--version"]);
console.log(value);{ code: 0, out: '1.2.0\n', err: '' }What it prints (run when this page was built)