(str)
| 548 | } |
| 549 | |
| 550 | styleUsage(str) { |
| 551 | // Usage has lots of parts the user might like to color separately! Assume default usage string which is formed like: |
| 552 | // command subcommand [options] [command] <foo> [bar] |
| 553 | return str |
| 554 | .split(' ') |
| 555 | .map((word) => { |
| 556 | if (word === '[options]') return this.styleOptionText(word); |
| 557 | if (word === '[command]') return this.styleSubcommandText(word); |
| 558 | if (word[0] === '[' || word[0] === '<') |
| 559 | return this.styleArgumentText(word); |
| 560 | return this.styleCommandText(word); // Restrict to initial words? |
| 561 | }) |
| 562 | .join(' '); |
| 563 | } |
| 564 | styleCommandDescription(str) { |
| 565 | return this.styleDescriptionText(str); |
| 566 | } |
no test coverage detected