MCPcopy Create free account
hub / github.com/Effect-TS/effect / getUsageInternal

Function getUsageInternal

packages/cli/src/internal/commandDescriptor.ts:477–501  ·  view source on GitHub ↗
(self: Instruction)

Source from the content-addressed store, hash-verified

475}
476
477const getUsageInternal = (self: Instruction): Usage.Usage => {
478 switch (self._tag) {
479 case "Standard": {
480 return InternalUsage.concat(
481 InternalUsage.named(Arr.of(self.name), Option.none()),
482 InternalUsage.concat(
483 InternalOptions.getUsage(self.options),
484 InternalArgs.getUsage(self.args)
485 )
486 )
487 }
488 case "GetUserInput": {
489 return InternalUsage.named(Arr.of(self.name), Option.none())
490 }
491 case "Map": {
492 return getUsageInternal(self.command)
493 }
494 case "Subcommands": {
495 return InternalUsage.concat(
496 getUsageInternal(self.parent),
497 InternalUsage.mixed
498 )
499 }
500 }
501}
502
503const parseInternal = (
504 self: Instruction,

Callers 3

getUsageFunction · 0.70
parseBuiltInArgsFunction · 0.70
parseInternalFunction · 0.70

Calls 1

ofMethod · 0.65

Tested by

no test coverage detected