(command, args)
| 210 | } |
| 211 | |
| 212 | function details(command, args) { |
| 213 | if (args.length === 0) { |
| 214 | return 'Not applicable.'; |
| 215 | } |
| 216 | |
| 217 | return args |
| 218 | .map( |
| 219 | (arg) => `### \`${arg.name}\` |
| 220 | |
| 221 | ${arg.describe || 'No description available.'} |
| 222 | |
| 223 | ${ |
| 224 | !arg.alts || arg.alts.length === 0 ? '' : `- Aliases: \`${arg.alts.map((m) => `--${m}`).join('`, `')}\`${nl}` |
| 225 | }- Type: \`${arg.type}\`${arg.values ? nl + `- Choices: \`${arg.values.join('`, `')}\`` : ''} |
| 226 | - Default: \`${arg.default}\`${arg.required ? nl + '- **Caution: This flag is required!**' : ''}${ |
| 227 | Array.isArray(arg.examples) && arg.examples.length > 0 |
| 228 | ? ` |
| 229 | |
| 230 | Examples: |
| 231 | |
| 232 | ${arg.examples.map((example) => shell(`${getCall(command)} ${example}`)).join(nl + nl)}` |
| 233 | : '' |
| 234 | }`, |
| 235 | ) |
| 236 | .join(nl + nl); |
| 237 | } |
| 238 | |
| 239 | function generateValidator(validator) { |
| 240 | return `### \`${validator.name}\` |
no test coverage detected