2 Copyright (c) 2012, Yahoo! Inc. All rights reserved.
3 Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
7 OPT_START = OPT_PREFIX.length,
10 wrap = require('wordwrap')(TEXT_START, STOP),
11 paraWrap = require('wordwrap')(1, STOP);
13 function formatPara(text) {
14 return paraWrap(text);
17 function formatOption(option, helpText) {
18 var formattedText = wrap(helpText);
20 if (option.length > TEXT_START - OPT_START - 2) {
21 return OPT_PREFIX + option + '\n' + formattedText;
23 return OPT_PREFIX + option + formattedText.substring((OPT_PREFIX + option).length);
28 formatPara: formatPara,
29 formatOption: formatOption