Path: blob/main/src/command/dev-call/make-ast-diagram/cmd.ts
3588 views
/*1* cmd.ts2*3* Copyright (C) 2025 Posit Software, PBC4*/56import { Command } from "cliffy/command/mod.ts";7import { join } from "../../../deno_ral/path.ts";8import { resourcePath } from "../../../core/resources.ts";9import { execProcess } from "../../../core/process.ts";1011export const makeAstDiagramCommand = new Command()12.name("make-ast-diagram")13.hidden()14.option("-m, --mode <mode:string>", "Diagram mode (default: full)")15.arguments("<arguments...>")16.description(17"Creates a diagram of the Pandoc AST.\n\n",18)19//deno-lint-ignore no-explicit-any20.action(async (options: any, ...args: string[]) => {21const renderOpts = {22cmd: Deno.execPath(),23args: [24"run",25"--allow-read",26"--allow-write",27"--allow-run",28resourcePath(join("tools", "ast-diagram", "main.ts")),29...args,30"--mode",31options.mode || "full",32],33};34await execProcess(renderOpts);35});363738