How to use the @zowe/imperative.DefaultHelpGenerator function in @zowe/imperative

To help you get started, we’ve selected a few @zowe/imperative examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IBM / zowe-cli-cics-deploy-plugin / gulp / GenerateDoc.ts View on Github external
if (child.type !== "command") {
                oldCommandName = " " + definition.name;
                getGroupHelp(child, indentLevel + 1);
                continue;
            }
            totalCommands++;
            const childAnchorTag = "command-" + child.name.replace(/\s/g, "-");
            let childNameSummary = child.name;
            if (child.experimental) {
                childNameSummary += " (experimental)";
            }

            tableOfContentsText += util.format("%s* [%s](#%s)\n", tabIndent.repeat(indentLevel + 1), childNameSummary, childAnchorTag);
            markdownContent += util.format("##%s %s<a name="\&quot;%s\&quot;"></a>\n", "#".repeat(indentLevel), childNameSummary, childAnchorTag);

            const helpGen = new DefaultHelpGenerator({
                produceMarkdown: true,
                rootCommandName: BINARY_NAME + oldCommandName
            } as any, {
                commandDefinition: child,
                fullCommandTree: definition
            });
            markdownContent += helpGen.buildHelp();
        }
        oldCommandName = "";
    }