lib/help/formatter.js
function (parts, indent, prefix) {
        var lines = [];
        var line = [];

        var lineLength = !!prefix ? prefix.length - 1: indent.length - 1;

        parts.forEach(function (part) {
          if (lineLength + 1 + part.length > textWidth) {
            lines.push(indent + line.join(' '));
            line = [];
            lineLength = indent.length - 1;
          }
          line.push(part);
          lineLength += part.length + 1;
        });

        if (line) {
          lines.push(indent + line.join(' '));
        }
        if (prefix) {
          lines[0] = lines[0].substr(indent.length);
        }
        return lines;
      }
function (parts, indent, prefix) {
        var lines = [];
        var line = [];

        var lineLength = !!prefix ? prefix.length - 1: indent.length - 1;

        parts.forEach(function (part) {
          if (lineLength + 1 + part.length > textWidth) {
            lines.push(indent + line.join(' '));
            line = [];
            lineLength = indent.length - 1;
          }
          line.push(part);
          lineLength += part.length + 1;
        });

        if (line) {
          lines.push(indent + line.join(' '));
        }
        if (prefix) {
          lines[0] = lines[0].substr(indent.length);
        }
        return lines;
      }
function ( parts , indent , prefix ) { var lines = [ ] ; var line = [ ] ; var lineLength = ! ! prefix ? prefix . length - 1 : indent . length - 1 ; parts . forEach ( function ( part ) { if ( lineLength + 1 + part . length > textWidth ) { lines . push ( indent + line . join ( ' ' ) ) ; line = [ ] ; lineLength = indent . length - 1 ; } line . push ( part ) ; lineLength += part . length + 1 ; } ) ; if ( line ) { lines . push ( indent + line . join ( ' ' ) ) ; } if ( prefix ) { lines [ 0 ] = lines [ 0 ] . substr ( indent . length ) ; } return lines ; }
helper for wrapping lines
helper for wrapping lines