added cli_test_run-samples to test samples from commandline; added --outputSuffix option

This commit is contained in:
whyzdev
2016-12-18 12:30:37 -05:00
parent 96a25935ac
commit e13c939583
10 changed files with 95 additions and 13 deletions

View File

@@ -21,6 +21,7 @@ function cli(options) {
help: 'h'
, png: 'p'
, outputDir: 'o'
, outputSuffix: 'O'
, svg: 's'
, verbose: 'v'
, phantomPath: 'e'
@@ -30,7 +31,7 @@ function cli(options) {
, width: 'w'
}
, 'boolean': ['help', 'png', 'svg', 'verbose']
, 'string': ['outputDir']
, 'string': ['outputDir', 'outputSuffix']
}
this.errors = []
@@ -45,6 +46,7 @@ function cli(options) {
, " -s --svg Output SVG instead of PNG (experimental)"
, " -p --png If SVG was selected, and you also want PNG, set this flag"
, " -o --outputDir Directory to save files, will be created automatically, defaults to `cwd`"
, " -O --outputSuffix Suffix to output filenames in front of '.svg' or '.png', defaults to ''"
, " -e --phantomPath Specify the path to the phantomjs executable"
, " -t --css Specify the path to a CSS file to be included when processing output"
, " -c --sequenceConfig Specify the path to the file with the configuration to be applied in the sequence diagram"
@@ -79,7 +81,7 @@ cli.prototype.parse = function(argv, next) {
}
// ensure that parameter-expecting options have parameters
;['outputDir', 'phantomPath', 'sequenceConfig', 'ganttConfig', 'css'].forEach(function(i) {
;['outputDir', 'outputSuffix', 'phantomPath', 'sequenceConfig', 'ganttConfig', 'css'].forEach(function(i) {
if(typeof options[i] !== 'undefined') {
if (typeof options[i] !== 'string' || options[i].length < 1) {
this.errors.push(new Error(i + " expects a value."))