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

Function getUsageInternal

packages/cli/src/internal/args.ts:646–674  ·  view source on GitHub ↗
(self: Instruction)

Source from the content-addressed store, hash-verified

644}
645
646const getUsageInternal = (self: Instruction): Usage.Usage => {
647 switch (self._tag) {
648 case "Empty": {
649 return InternalUsage.empty
650 }
651 case "Single": {
652 return InternalUsage.named(
653 Arr.of(self.name),
654 InternalPrimitive.getChoices(self.primitiveType)
655 )
656 }
657 case "Map": {
658 return getUsageInternal(self.args as Instruction)
659 }
660 case "Both": {
661 return InternalUsage.concat(
662 getUsageInternal(self.left as Instruction),
663 getUsageInternal(self.right as Instruction)
664 )
665 }
666 case "Variadic": {
667 return InternalUsage.repeated(getUsageInternal(self.args as Instruction))
668 }
669 case "WithDefault":
670 case "WithFallbackConfig": {
671 return InternalUsage.optional(getUsageInternal(self.args as Instruction))
672 }
673 }
674}
675
676const makeSingle = <A>(
677 pseudoName: Option.Option<string>,

Callers 1

getUsageFunction · 0.70

Calls 1

ofMethod · 0.65

Tested by

no test coverage detected