MCPcopy
hub / github.com/tj/commander.js / padWidth

Method padWidth

lib/help.js:619–626  ·  view source on GitHub ↗

* Calculate the pad width from the maximum term length. * * @param {Command} cmd * @param {Help} helper * @returns {number}

(cmd, helper)

Source from the content-addressed store, hash-verified

617 */
618
619 padWidth(cmd, helper) {
620 return Math.max(
621 helper.longestOptionTermLength(cmd, helper),
622 helper.longestGlobalOptionTermLength(cmd, helper),
623 helper.longestSubcommandTermLength(cmd, helper),
624 helper.longestArgumentTermLength(cmd, helper),
625 );
626 }
627
628 /**
629 * Detect manually wrapped and indented strings by checking for line break followed by whitespace.

Callers 3

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

Tested by

no test coverage detected