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

Function withDescriptionInternal

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

Source from the content-addressed store, hash-verified

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