| 323 | // - name (entry name, typically a command name) |
| 324 | // - body (contents of body, trimmed to end with a newline but no blank lines) |
| 325 | var loadHelp = function () { |
| 326 | var dirname = files.convertToStandardPath(__dirname); |
| 327 | var raw = files.readFile(files.pathJoin(dirname, 'help.txt'), 'utf8'); |
| 328 | return _.map(raw.split(/^>>>/m).slice(1), function (r) { |
| 329 | var lines = r.split('\n'); |
| 330 | var name = lines.shift().trim(); |
| 331 | return { |
| 332 | name: name, |
| 333 | body: lines.join('\n').replace(/\s*$/, '') + '\n' |
| 334 | }; |
| 335 | }); |
| 336 | }; |
| 337 | |
| 338 | var longHelp = exports.longHelp = function (commandName) { |
| 339 | commandName = commandName.trim(); |