Comparing version 0.1.16 to 1.0.0
@@ -6,4 +6,4 @@ 'use strict'; | ||
var assert = require('assert'); | ||
var _ = require('underscore'); | ||
_.str = require('underscore.string'); | ||
var print = function () { | ||
@@ -10,0 +10,0 @@ return console.log.apply(console, arguments); |
@@ -10,6 +10,4 @@ /** internal | ||
var format = require('util').format; | ||
var _ = require('underscore'); | ||
var _ = require('lodash'); | ||
_.str = require('underscore.string'); | ||
// Constants | ||
@@ -397,3 +395,3 @@ var $$ = require('./const'); | ||
var optionStringDest = optionStringsLong.length ? optionStringsLong[0] :optionStrings[0]; | ||
dest = _.str.strip(optionStringDest, this.prefixChars); | ||
dest = _.trim(optionStringDest, this.prefixChars); | ||
@@ -427,3 +425,3 @@ if (dest.length === 0) { | ||
var handlerString = this.conflictHandler; | ||
var handlerFuncName = "_handleConflict" + _.str.capitalize(handlerString); | ||
var handlerFuncName = "_handleConflict" + _.capitalize(handlerString); | ||
var func = this[handlerFuncName]; | ||
@@ -430,0 +428,0 @@ if (typeof func === 'undefined') { |
@@ -12,3 +12,3 @@ /** internal | ||
var format = require('util').format; | ||
var _ = require('underscore'); | ||
var _ = require('lodash'); | ||
@@ -15,0 +15,0 @@ |
@@ -14,4 +14,4 @@ /** | ||
var _ = require('underscore'); | ||
_.str = require('underscore.string'); | ||
var _ = require('lodash'); | ||
var sprintf = require('sprintf-js').sprintf; | ||
@@ -185,3 +185,3 @@ // Constants | ||
formatter.addUsage(this.usage, positionals, groups, ''); | ||
options.prog = _.str.strip(formatter.formatHelp()); | ||
options.prog = _.trim(formatter.formatHelp()); | ||
} | ||
@@ -451,3 +451,3 @@ | ||
var message = 'ignored explicit argument %r'; | ||
throw argumentErrorHelper(action, _.str.sprintf(message, explicitArg)); | ||
throw argumentErrorHelper(action, sprintf(message, explicitArg)); | ||
} | ||
@@ -573,3 +573,3 @@ } | ||
// if we didn't consume all the argument strings, there were extras | ||
extras = extras.concat(_.rest(argStrings, stopIndex)); | ||
extras = extras.concat(argStrings.slice(stopIndex)); | ||
@@ -879,3 +879,3 @@ // if we didn't use all the Positional objects, there were too few | ||
default: | ||
regexpNargs = '(-*' + _.str.repeat('-*A', action.nargs) + '-*)'; | ||
regexpNargs = '(-*' + _.repeat('-*A', action.nargs) + '-*)'; | ||
} | ||
@@ -882,0 +882,0 @@ |
'use strict'; | ||
var util = require('util'); | ||
var _ = require('underscore'); | ||
_.str = require('underscore.string'); | ||
var _ = require('lodash'); | ||
// Constants | ||
@@ -62,3 +62,3 @@ var $$ = require('../const'); | ||
lines = lines.map(function (line) { | ||
return _.str.rtrim(indent + line); | ||
return _.trimRight(indent + line); | ||
}); | ||
@@ -65,0 +65,0 @@ return lines.join('\n'); |
@@ -16,4 +16,4 @@ /** | ||
var _ = require('underscore'); | ||
_.str = require('underscore.string'); | ||
var _ = require('lodash'); | ||
var sprintf = require('sprintf-js').sprintf; | ||
@@ -84,3 +84,3 @@ // Constants | ||
var currentIndent = formatter.currentIndent; | ||
heading = _.str.repeat(' ', currentIndent) + this._heading + ':' + $$.EOL; | ||
heading = _.repeat(' ', currentIndent) + this._heading + ':' + $$.EOL; | ||
} | ||
@@ -304,3 +304,3 @@ | ||
help = help.replace(this._longBreakMatcher, $$.EOL + $$.EOL); | ||
help = _.str.strip(help, $$.EOL) + $$.EOL; | ||
help = _.trim(help, $$.EOL) + $$.EOL; | ||
} | ||
@@ -327,3 +327,3 @@ return help; | ||
if (usage) { | ||
usage = _.str.sprintf(usage, {prog: this._prog}); | ||
usage = sprintf(usage, {prog: this._prog}); | ||
@@ -404,3 +404,3 @@ // if no optionals or positionals are available, usage is just prog | ||
if (prefix.length + prog.length <= 0.75 * textWidth) { | ||
indent = _.str.repeat(' ', (prefix.length + prog.length + 1)); | ||
indent = _.repeat(' ', (prefix.length + prog.length + 1)); | ||
if (optionalParts) { | ||
@@ -419,3 +419,3 @@ lines = [].concat( | ||
} else { | ||
indent = _.str.repeat(' ', prefix.length); | ||
indent = _.repeat(' ', prefix.length); | ||
parts = optionalParts + positionalParts; | ||
@@ -558,3 +558,3 @@ lines = _getLines(parts, indent); | ||
text = _.str.strip(text); | ||
text = _.trim(text); | ||
@@ -566,5 +566,5 @@ // return the text | ||
HelpFormatter.prototype._formatText = function (text) { | ||
text = _.str.sprintf(text, {prog: this._prog}); | ||
text = sprintf(text, {prog: this._prog}); | ||
var textWidth = this._width - this._currentIndent; | ||
var indentIncriment = _.str.repeat(' ', this._currentIndent); | ||
var indentIncriment = _.repeat(' ', this._currentIndent); | ||
return this._fillText(text, textWidth, indentIncriment) + $$.EOL + $$.EOL; | ||
@@ -589,10 +589,10 @@ }; | ||
if (!action.help) { | ||
actionHeader = _.str.repeat(' ', this._currentIndent) + actionHeader + $$.EOL; | ||
actionHeader = _.repeat(' ', this._currentIndent) + actionHeader + $$.EOL; | ||
// short action name; start on the same line and pad two spaces | ||
} else if (actionHeader.length <= actionWidth) { | ||
actionHeader = _.str.repeat(' ', this._currentIndent) + | ||
actionHeader = _.repeat(' ', this._currentIndent) + | ||
actionHeader + | ||
' ' + | ||
_.str.repeat(' ', actionWidth - actionHeader.length); | ||
_.repeat(' ', actionWidth - actionHeader.length); | ||
indentFirst = 0; | ||
@@ -602,3 +602,3 @@ | ||
} else { | ||
actionHeader = _.str.repeat(' ', this._currentIndent) + actionHeader + $$.EOL; | ||
actionHeader = _.repeat(' ', this._currentIndent) + actionHeader + $$.EOL; | ||
indentFirst = helpPosition; | ||
@@ -614,5 +614,5 @@ } | ||
helpLines = this._splitLines(helpText, helpWidth); | ||
parts.push(_.str.repeat(' ', indentFirst) + helpLines[0] + $$.EOL); | ||
parts.push(_.repeat(' ', indentFirst) + helpLines[0] + $$.EOL); | ||
helpLines.slice(1).forEach(function (line) { | ||
parts.push(_.str.repeat(' ', helpPosition) + line + $$.EOL); | ||
parts.push(_.repeat(' ', helpPosition) + line + $$.EOL); | ||
}); | ||
@@ -758,3 +758,3 @@ | ||
return _.str.sprintf(this._getHelpString(action), params); | ||
return sprintf(this._getHelpString(action), params); | ||
}; | ||
@@ -769,3 +769,3 @@ | ||
text = _.str.strip(text); | ||
text = _.trim(text); | ||
text = text.replace(this._whitespaceMatcher, ' '); | ||
@@ -772,0 +772,0 @@ |
@@ -13,3 +13,3 @@ /** | ||
var _ = require('underscore'); | ||
var _ = require('lodash'); | ||
@@ -16,0 +16,0 @@ /** |
{ | ||
"name" : "argparse", | ||
"description" : "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", | ||
"version" : "0.1.16", | ||
"keywords" : ["cli", "parser", "argparse", "option", "args"], | ||
"homepage" : "https://github.com/nodeca/argparse", | ||
"contributors" : ["Eugene Shkuropat", "Paul Jacobson"], | ||
"bugs" : { "url": "https://github.com/nodeca/argparse/issues" }, | ||
"license" : "MIT", | ||
"repository" : { "type": "git", "url": "git://github.com/nodeca/argparse.git" }, | ||
"main" : "./index.js", | ||
"scripts" : { | ||
"test": "make test" | ||
}, | ||
"dependencies" : { | ||
"underscore" : "~1.7.0", | ||
"underscore.string" : "~2.4.0" | ||
}, | ||
"devDependencies" : { "mocha": "*" } | ||
"name": "argparse", | ||
"description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", | ||
"version": "1.0.0", | ||
"keywords": [ | ||
"cli", | ||
"parser", | ||
"argparse", | ||
"option", | ||
"args" | ||
], | ||
"homepage": "https://github.com/nodeca/argparse", | ||
"contributors": [ | ||
"Eugene Shkuropat", | ||
"Paul Jacobson" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/nodeca/argparse/issues" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/nodeca/argparse.git" | ||
}, | ||
"main": "./index.js", | ||
"scripts": { | ||
"test": "make test" | ||
}, | ||
"dependencies": { | ||
"lodash": "^3.2.0", | ||
"sprintf-js": "~1.0.2" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*" | ||
} | ||
} |
@@ -11,5 +11,8 @@ argparse | ||
**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/). | ||
**NB. Difference with original.** | ||
- Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/). | ||
- Use `defaultValue` instead of `default`. | ||
Example | ||
@@ -16,0 +19,0 @@ ======= |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
243
125042
3475
+ Addedlodash@^3.2.0
+ Addedsprintf-js@~1.0.2
+ Addedlodash@3.10.1(transitive)
+ Addedsprintf-js@1.0.3(transitive)
- Removedunderscore@~1.7.0
- Removedunderscore.string@~2.4.0
- Removedunderscore@1.7.0(transitive)
- Removedunderscore.string@2.4.0(transitive)