MCPcopy
hub / github.com/jsdoc/jsdoc / help

Method help

lib/jsdoc/opts/argparser.js:185–216  ·  view source on GitHub ↗

* Generate a summary of all the options with corresponding help text. * @returns {string}

()

Source from the content-addressed store, hash-verified

183 * @returns {string}
184 */
185 help() {
186 const options = {
187 names: [],
188 descriptions: []
189 };
190
191 this._options.forEach(option => {
192 let name = '';
193
194 // don't show ignored options
195 if (option.ignore) {
196 return;
197 }
198
199 if (option.shortName) {
200 name += `-${option.shortName}${option.longName ? ', ' : ''}`;
201 }
202
203 if (option.longName) {
204 name += `--${option.longName}`;
205 }
206
207 if (option.hasValue) {
208 name += ' <value>';
209 }
210
211 options.names.push(name);
212 options.descriptions.push(option.helpText);
213 });
214
215 return `Options:\n${formatHelpInfo(options).join('\n')}`;
216 }
217
218 /**
219 * Get the options.

Callers 3

cli.jsFile · 0.80
args.jsFile · 0.80
argparser.jsFile · 0.80

Calls 1

formatHelpInfoFunction · 0.85

Tested by

no test coverage detected