Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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="\"%s\""></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 = "";
}