MCPcopy Index your code
hub / github.com/tj/commander.js / styleSubcommandTerm

Method styleSubcommandTerm

lib/help.js:582–594  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

580 return this.styleOptionText(str);
581 }
582 styleSubcommandTerm(str) {
583 // This is very like usage with lots of parts! Assume default string which is formed like:
584 // subcommand [options] <foo> [bar]
585 return str
586 .split(' ')
587 .map((word) => {
588 if (word === '[options]') return this.styleOptionText(word);
589 if (word[0] === '[' || word[0] === '<')
590 return this.styleArgumentText(word);
591 return this.styleSubcommandText(word); // Restrict to initial words?
592 })
593 .join(' ');
594 }
595 styleArgumentTerm(str) {
596 return this.styleArgumentText(str);
597 }

Callers 3

formatHelpMethod · 0.80
index.test-d.tsFile · 0.80

Calls 3

styleOptionTextMethod · 0.95
styleArgumentTextMethod · 0.95
styleSubcommandTextMethod · 0.95

Tested by

no test coverage detected