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

Function getUsageInternal

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

Source from the content-addressed store, hash-verified

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

Callers 1

getUsageFunction · 0.70

Calls 1

ofMethod · 0.65

Tested by

no test coverage detected