Comparing version 1.1.3 to 1.1.5
@@ -8,20 +8,18 @@ #!/usr/bin/env node | ||
.version(pkg.version) | ||
.help('info') | ||
.help('cmdline help') | ||
.error(function (err) { | ||
console.error('ERR:', err.message); | ||
console.error(err.message); | ||
process.exit(1); | ||
}) | ||
.option('-t', { command: '', type: 'switch' }) | ||
.command('start', function (cmd, t) { | ||
console.log('cmd:', t); | ||
.option('-t', 'switch') | ||
.command('start') | ||
.help('start help') | ||
.root.action(function ($1, $2) { | ||
console.log('argv:', $1); | ||
//return false; | ||
}, true) | ||
.handle({ arguments: true }, function ($0, $1) { | ||
console.log('argv:', $0); | ||
//return false; | ||
}) | ||
.handle(function ($0) { | ||
console.log('default:', $0); | ||
}, false) | ||
.action(function ($1) { | ||
console.log('default:', $1); | ||
console.log('has t:', this.has('t')); | ||
}) | ||
}, false) | ||
.ready(); |
{ | ||
"name": "cmdline", | ||
"rawName": "cmdline", | ||
"version": "1.1.3", | ||
"version": "1.1.5", | ||
"description": "cmdline is a process.argv parser", | ||
"main": "./lib/index.js", | ||
"main": "./index.js", | ||
"scripts": { | ||
@@ -38,3 +38,3 @@ "test": "echo \"There is no test\" && exit 1" | ||
"dependencies": { | ||
"cify": "^1.0.0", | ||
"cify": "^1.0.2", | ||
"ntils": "^1.0.2" | ||
@@ -41,0 +41,0 @@ }, |
@@ -1,21 +0,20 @@ | ||
const Parser = require('../').Parser; | ||
const Command = require('../').Command; | ||
const parser = new Parser({ | ||
argv: ["abv", "-tx", "9", "c a", "b"] | ||
}); | ||
const command = new Command(); | ||
parser | ||
.option(['-t', '--tab'], { | ||
regexp: /[0-9]+/i, | ||
default: 1 | ||
command | ||
.option(['-t', '--tab'], 'number') | ||
.option(['-x'], 'number') | ||
.action(function (command, $1) { | ||
console.log('command:', command); | ||
}, false) | ||
.command(/[\S\s]*/) | ||
.option(['-t', '--tab'], 'number') | ||
.option(['-x'], 'number') | ||
.action(function (cmd) { | ||
console.log(cmd); | ||
}) | ||
.handle(function (command) { | ||
console.log('command1:', command); | ||
}) | ||
.command(/./, function (command) { | ||
console.log('command2:', command); | ||
}) | ||
.ready(); | ||
console.log('argv:', parser.argv); | ||
console.log('options:', parser.options); | ||
console.log('argv:', command.argv); | ||
console.log('options:', command.options); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
18219
12
608
1
Updatedcify@^1.0.2