MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / printOptionManualRow

Function printOptionManualRow

cli/src/cli/help.ts:114–132  ·  view source on GitHub ↗
(longName: string, opt: Option)

Source from the content-addressed store, hash-verified

112 if (opt.multiple) {
113 token += '...';
114 }
115 }
116 return optional ? `[${token}]` : token;
117}
118
119function printOptionManualRow(longName: string, opt: Option) {
120 const synopsis = buildCommandSynopsisOptionColumn(longName, opt);
121 const description = buildCommandOptionDescription(opt);
122 const descriptionWidth = Math.max(24, 80 - OPTION_DESCRIPTION_PAD.length);
123 const descriptionLines = wrapText(description, descriptionWidth);
124
125 if (synopsis.length > OPTION_COLUMN_WIDTH) {
126 console.log(`${ROW_INDENT}${synopsis}`);
127 for (const line of descriptionLines) {
128 console.log(`${OPTION_DESCRIPTION_PAD}${line}`);
129 }
130 return;
131 }
132
133 console.log(`${ROW_INDENT}${synopsis.padEnd(OPTION_COLUMN_WIDTH)}${descriptionLines[0] ?? ''}`);
134 for (let i = 1; i < descriptionLines.length; i++) {
135 console.log(`${OPTION_DESCRIPTION_PAD}${descriptionLines[i]}`);

Callers 1

printCommandUsageFunction · 0.85

Calls 4

wrapTextFunction · 0.85
logMethod · 0.65

Tested by

no test coverage detected