Socket
Socket
Sign inDemoInstall

commander

Package Overview
Dependencies
1
Maintainers
1
Versions
115
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

6

History.md
1.1.1 / 2012-11-20
==================
* add more sub-command padding
* fix .usage() when args are present. Closes #106
1.1.0 / 2012-11-16

@@ -3,0 +9,0 @@ ==================

21

index.js

@@ -94,3 +94,3 @@ /*!

this.options = [];
this.args = [];
this._args = [];
this._name = name;

@@ -193,6 +193,6 @@ }

case '<':
self.args.push({ required: true, name: arg.slice(1, -1) });
self._args.push({ required: true, name: arg.slice(1, -1) });
break;
case '[':
self.args.push({ required: false, name: arg.slice(1, -1) });
self._args.push({ required: false, name: arg.slice(1, -1) });
break;

@@ -241,3 +241,3 @@ }

self.args.forEach(function(arg, i){
self._args.forEach(function(arg, i){
if (arg.required && null == args[i]) {

@@ -251,4 +251,4 @@ self.missingArgument(arg.name);

// expects
if (self.args.length) {
args[self.args.length] = self;
if (self._args.length) {
args[self._args.length] = self;
} else {

@@ -683,3 +683,3 @@ args.push(self);

Command.prototype.usage = function(str){
var args = this.args.map(function(arg){
var args = this._args.map(function(arg){
return arg.required

@@ -693,3 +693,4 @@ ? '<' + arg.name + '>'

+ ']'
+ (this.args.length ? ' ' + args : '');
+ (this._args.length ? ' ' + args : '');
if (0 == arguments.length) return this._usage || usage;

@@ -747,3 +748,3 @@ this._usage = str;

, this.commands.map(function(cmd){
var args = cmd.args.map(function(arg){
var args = cmd._args.map(function(arg){
return arg.required

@@ -757,3 +758,3 @@ ? '<' + arg.name + '>'

? ' [options]'
: '') + ' ' + args, 18)
: '') + ' ' + args, 22)
+ (cmd.description()

@@ -760,0 +761,0 @@ ? ' ' + cmd.description()

{
"name": "commander"
, "version": "1.1.0"
, "version": "1.1.1"
, "description": "the complete solution for node.js command-line programs"

@@ -5,0 +5,0 @@ , "keywords": ["command", "option", "parser", "prompt", "stdin"]

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc