MCPcopy
hub / github.com/Effect-TS/effect / withDescriptionInternal

Function withDescriptionInternal

packages/cli/src/internal/args.ts:864–902  ·  view source on GitHub ↗
(self: Instruction, description: string)

Source from the content-addressed store, hash-verified

862}
863
864const withDescriptionInternal = (self: Instruction, description: string): Args.Args<any> => {
865 switch (self._tag) {
866 case "Empty": {
867 return none
868 }
869 case "Single": {
870 const desc = InternalHelpDoc.sequence(self.description, InternalHelpDoc.p(description))
871 return makeSingle(self.pseudoName, self.primitiveType, desc)
872 }
873 case "Map": {
874 return makeMap(withDescriptionInternal(self.args as Instruction, description), self.f)
875 }
876 case "Both": {
877 return makeBoth(
878 withDescriptionInternal(self.left as Instruction, description),
879 withDescriptionInternal(self.right as Instruction, description)
880 )
881 }
882 case "Variadic": {
883 return makeVariadic(
884 withDescriptionInternal(self.args as Instruction, description),
885 self.min,
886 self.max
887 )
888 }
889 case "WithDefault": {
890 return makeWithDefault(
891 withDescriptionInternal(self.args as Instruction, description),
892 self.fallback
893 )
894 }
895 case "WithFallbackConfig": {
896 return makeWithFallbackConfig(
897 withDescriptionInternal(self.args as Instruction, description),
898 self.config
899 )
900 }
901 }
902}
903
904const wizardInternal = (self: Instruction, config: CliConfig.CliConfig): Effect.Effect<
905 Array<string>,

Callers 1

args.tsFile · 0.70

Calls 6

makeWithFallbackConfigFunction · 0.85
makeSingleFunction · 0.70
makeMapFunction · 0.70
makeBothFunction · 0.70
makeVariadicFunction · 0.70
makeWithDefaultFunction · 0.70

Tested by

no test coverage detected