New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cmdline

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmdline - npm Package Compare versions

Comparing version 1.1.3 to 1.1.5

index.js

24

bin/cli.js

@@ -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);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc