Files
PolyMPR/toolbox/cli.ts
T
2025-01-22 14:24:55 +01:00

24 lines
618 B
TypeScript

import { type ParseOptions } from "@std/cli/parse-args";
import { createModule } from "$root/toolbox/module/create.ts";
import { listModules } from "$root/toolbox/module/list.ts";
import { CLI, displayHelp } from "$root/toolbox/cli/help.ts";
import { main } from "$root/toolbox/cli/main.ts";
/**
* CLI will use `args._`, but you can define options for global CLI.
*/
const argSpec: ParseOptions = {};
/**
* Configure CLI commands here.
*/
const cli: CLI = {
help: () => displayHelp(cli),
module: {
list: () => listModules(),
create: (name: string) => createModule(name),
},
};
main(cli, argSpec);