* Get the command term to show in the list of subcommands. * * @param {Command} cmd * @returns {string}
(cmd)
| 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. |
no test coverage detected