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

Function withDescriptionInternal

packages/cli/src/internal/commandDescriptor.ts:831–866  ·  view source on GitHub ↗
(
  self: Instruction,
  description: string | HelpDoc.HelpDoc
)

Source from the content-addressed store, hash-verified

829}
830
831const withDescriptionInternal = (
832 self: Instruction,
833 description: string | HelpDoc.HelpDoc
834): Descriptor.Command<any> => {
835 switch (self._tag) {
836 case "Standard": {
837 const helpDoc = typeof description === "string" ? HelpDoc.p(description) : description
838 const op = Object.create(proto)
839 op._tag = "Standard"
840 op.name = self.name
841 op.description = helpDoc
842 op.options = self.options
843 op.args = self.args
844 return op
845 }
846 case "GetUserInput": {
847 const helpDoc = typeof description === "string" ? HelpDoc.p(description) : description
848 const op = Object.create(proto)
849 op._tag = "GetUserInput"
850 op.name = self.name
851 op.description = helpDoc
852 op.prompt = self.prompt
853 return op
854 }
855 case "Map": {
856 return mapEffect(withDescriptionInternal(self.command, description), self.f)
857 }
858 case "Subcommands": {
859 const op = Object.create(proto)
860 op._tag = "Subcommands"
861 op.parent = withDescriptionInternal(self.parent, description)
862 op.children = self.children.slice()
863 return op
864 }
865 }
866}
867
868const argsWizardHeader = InternalSpan.code("Args Wizard - ")
869const optionsWizardHeader = InternalSpan.code("Options Wizard - ")

Callers 1

Calls 1

createMethod · 0.80

Tested by

no test coverage detected