MCPcopy Index your code
hub / github.com/Effect-TS/effect / prefixCommand

Function prefixCommand

packages/cli/src/internal/cliApp.ts:303–329  ·  view source on GitHub ↗
(self: Command.Command<A>)

Source from the content-addressed store, hash-verified

301}
302
303const prefixCommand = <A>(self: Command.Command<A>): ReadonlyArray<string> => {
304 let command: InternalCommand.Instruction | undefined = self as InternalCommand.Instruction
305 let prefix: ReadonlyArray<string> = Arr.empty()
306 while (command !== undefined) {
307 switch (command._tag) {
308 case "Standard": {
309 prefix = Arr.of(command.name)
310 command = undefined
311 break
312 }
313 case "GetUserInput": {
314 prefix = Arr.of(command.name)
315 command = undefined
316 break
317 }
318 case "Map": {
319 command = command.command
320 break
321 }
322 case "Subcommands": {
323 command = command.parent
324 break
325 }
326 }
327 }
328 return prefix
329}
330
331const getWizardPrefix = (
332 builtIn: BuiltInOptions.ShowWizard,

Callers 1

cliApp.tsFile · 0.85

Calls 1

ofMethod · 0.65

Tested by

no test coverage detected