MCPcopy Index your code
hub / github.com/TypeScriptToLua/TypeScriptToLua / getHelpString

Function getHelpString

src/cli/information.ts:17–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15`.trim();
16
17export function getHelpString(): string {
18 let result = helpString + "\n\n";
19
20 result += "Options:\n";
21 for (const option of optionDeclarations) {
22 const aliasStrings = (option.aliases ?? []).map(a => "-" + a);
23 const optionString = [...aliasStrings, "--" + option.name].join("|");
24
25 const valuesHint = option.type === "enum" ? option.choices.join("|") : option.type;
26 const spacing = " ".repeat(Math.max(1, 45 - optionString.length - valuesHint.length));
27
28 result += `\n ${optionString} <${valuesHint}>${spacing}${option.description}\n`;
29 }
30
31 return result;
32}

Callers 1

executeCommandLineFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected