mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-28 21:23:37 +00:00
13 lines
424 B
TypeScript
13 lines
424 B
TypeScript
// Test helper for running Commander commands with captured output.
|
|
import { Command } from "commander";
|
|
|
|
/** Runs a CLI registrar against Commander using user-style argv. */
|
|
export async function runRegisteredCli(params: {
|
|
register: (program: Command) => void;
|
|
argv: string[];
|
|
}): Promise<void> {
|
|
const program = new Command();
|
|
params.register(program);
|
|
await program.parseAsync(params.argv, { from: "user" });
|
|
}
|