( self: Instruction, description: string | HelpDoc.HelpDoc )
| 829 | } |
| 830 | |
| 831 | const 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 | |
| 868 | const argsWizardHeader = InternalSpan.code("Args Wizard - ") |
| 869 | const optionsWizardHeader = InternalSpan.code("Options Wizard - ") |
no test coverage detected