* Get an array of the arguments if any have a description. * * @param {Command} cmd * @returns {Argument[]}
(cmd)
| 138 | */ |
| 139 | |
| 140 | visibleArguments(cmd) { |
| 141 | // Side effect! Apply the legacy descriptions before the arguments are displayed. |
| 142 | if (cmd._argsDescription) { |
| 143 | cmd.registeredArguments.forEach((argument) => { |
| 144 | argument.description = |
| 145 | argument.description || cmd._argsDescription[argument.name()] || ''; |
| 146 | }); |
| 147 | } |
| 148 | |
| 149 | // If there are any arguments with a description then return all the arguments. |
| 150 | if (cmd.registeredArguments.find((argument) => argument.description)) { |
| 151 | return cmd.registeredArguments; |
| 152 | } |
| 153 | return []; |
| 154 | } |
| 155 | |
| 156 | /** |
| 157 | * Get the command term to show in the list of subcommands. |
no test coverage detected