MCPcopy
hub / github.com/tj/commander.js / subcommandTerm

Method subcommandTerm

lib/help.js:163–174  ·  view source on GitHub ↗

* Get the command term to show in the list of subcommands. * * @param {Command} cmd * @returns {string}

(cmd)

Source from the content-addressed store, hash-verified

161 */
162
163 subcommandTerm(cmd) {
164 // Legacy. Ignores custom usage string, and nested commands.
165 const args = cmd.registeredArguments
166 .map((arg) => humanReadableArgName(arg))
167 .join(' ');
168 return (
169 cmd._name +
170 (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +
171 (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option
172 (args ? ' ' + args : '')
173 );
174 }
175
176 /**
177 * Get the option term to show in the list of options.

Calls 1

humanReadableArgNameFunction · 0.90

Tested by

no test coverage detected