command-line-args
Advanced tools
Comparing version 0.3.0 to 0.3.1
var a = require("array-tools"), | ||
o = require("object-tools"), | ||
s = require("string-tools"), | ||
util = require("util"), | ||
@@ -128,3 +129,13 @@ Design = require("nature").Design, | ||
}); | ||
if (!data.columns) { | ||
var width = data.options.reduce(function(prev, curr){ | ||
return curr.column1.length > prev ? curr.column1.length : prev; | ||
}, 0); | ||
data.columns = [ width + 2 ]; | ||
} | ||
data.options = data.options.map(function(option){ | ||
option.description = option.description && option.description.replace(/\n/g, "\n" + s.fill(" ", data.columns[0] + 2)) | ||
return option; | ||
}); | ||
return handlebars.compile(template)(data); | ||
}; |
{ | ||
"name": "command-line-args", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Command-line parser, usage text producer", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/75lb/command-line-args.git", |
19305
534