MCPcopy Create free account
hub / github.com/blockmatic/basilic / getOrCreateCommand

Function getOrCreateCommand

packages/cli/src/cli.ts:119–127  ·  view source on GitHub ↗
(parent: Command, pathSegment: string)

Source from the content-addressed store, hash-verified

117const commandCache = new Map<string, Command>()
118
119function getOrCreateCommand(parent: Command, pathSegment: string): Command {
120 const fullPath = parent === program ? pathSegment : `${parent.name()} ${pathSegment}`
121 const cached = commandCache.get(fullPath)
122 if (cached) return cached
123
124 const cmd = parent.command(pathSegment)
125 commandCache.set(fullPath, cmd)
126 return cmd
127}
128
129type CommandSpec = (typeof commandSpecs)[number]
130type OperationMeta = (typeof operationMeta)[keyof typeof operationMeta]

Callers 1

cli.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected