Comparing version 10.0.1 to 10.0.2
{ | ||
"name": "sergeant", | ||
"version": "10.0.1", | ||
"version": "10.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "code/main.js", |
@@ -9,21 +9,13 @@ # sergeant | ||
var app = require('sergeant')() | ||
var assert = require('assert') | ||
app.command('command1') | ||
.parameter('title', function (val) { | ||
// validate parameters and options by throwing exceptions | ||
assert.ok(typeof val === 'string') | ||
.parameter('title', 'the title') | ||
.option('option1', 'option 1') | ||
.action(function (args) { | ||
assert.ok(args.get('title'), 'the title is required') | ||
return val + '...' // transform them | ||
}) | ||
.option('option1', function (val) { | ||
// validate options and options by throwing exceptions | ||
assert.ok(typeof val === 'string') | ||
return Promise.resolve(true) | ||
}) | ||
return val + '...' // transform them | ||
}) | ||
.action(function (args) { | ||
return Promise.resolve(true) | ||
}) | ||
``` |
16699
21