Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated history/docs

  • Loading branch information...
commit 989a1a5046fe73ddbce94d973c7a2b14f9aad3f1 1 parent ab7465b
@puzrin puzrin authored
View
3  HISTORY.md
@@ -1,8 +1,9 @@
-0.1.11 / 2013-02-05
+0.1.11 / 2013-02-07
* Multiple bugfixes, @hpaulj
* Added 70+ tests (ported from python), @hpaulj
* Added conflictHandler, @applepicke
+* Added fromfilePrefixChar, @hpaulj
0.1.10 / 2012-12-30
View
6 lib/action_container.js
@@ -235,6 +235,12 @@ ActionContainer.prototype.addArgumentGroup = function (options) {
return group;
};
+/**
+ * ActionContainer#addMutuallyExclusiveGroup(options) -> ArgumentGroup
+ * - options (Object): {required: false}
+ *
+ * Create new mutual exclusive groups
+ **/
ActionContainer.prototype.addMutuallyExclusiveGroup = function (options) {
var group = new MutuallyExclusiveGroup(this, options);
this._mutuallyExclusiveGroups.push(group);
View
9 lib/argument/exclusive.js
@@ -1,5 +1,5 @@
/** internal
- * class ArgumentGroup
+ * class MutuallyExclusiveGroup
*
* Group arguments.
* By default, ArgumentParser groups command-line arguments
@@ -17,10 +17,11 @@ var util = require('util');
var ArgumentGroup = require('./group');
/**
- * new MutuallyExclusiveGroup(container, required)
+ * new MutuallyExclusiveGroup(container, options)
* - container (object): main container
- * - options.required: true/false
- * (required could be an argument itself, but making it a property of
+ * - options (object): options.required -> true/false
+ *
+ * `required` could be an argument itself, but making it a property of
* the options argument is more consistent with the JS adaptation of the Python)
**/
var MutuallyExclusiveGroup = module.exports = function MutuallyExclusiveGroup(container, options) {
View
12 test/fromfile.js
@@ -60,7 +60,7 @@ function setup_files() {
});
}
-describe('fromfilePrefixchars', function () {
+describe('from file', function () {
var parser;
var args;
before(function () {
@@ -75,7 +75,7 @@ describe('fromfilePrefixchars', function () {
after(function () {
teardown_tempdir(oldcwd);
});
- it("Test reading arguments from a file", function () {
+ it("test reading arguments from a file", function () {
args = parser.parseArgs(['X', 'Y']);
assert.deepEqual(args, {a: null, x: 'X', y: ['Y']});
args = parser.parseArgs(['X', '-a', 'A', 'Y', 'Z']);
@@ -85,13 +85,13 @@ describe('fromfilePrefixchars', function () {
args = parser.parseArgs(['X', '@hello']);
assert.deepEqual(args, {a: null, x: 'X', y: ['hello world!']});
});
- it("Test recursive reading arguments from files", function () {
+ it("test recursive reading arguments from files", function () {
args = parser.parseArgs(['-a', 'B', '@recursive', 'Y', 'Z']);
assert.deepEqual(args, {a: 'A', x: 'hello world!', y: ['Y', 'Z']});
args = parser.parseArgs(['X', '@recursive', 'Z', '-a', 'B']);
assert.deepEqual(args, {a: 'B', x: 'X', y: ['hello world!', 'Z']});
});
- it('Test reading arguments from an invalid file', function () {
+ it('fest reading arguments from an invalid file', function () {
assert.throws(
function () {
args = parser.parseArgs(['@invalid']);
@@ -99,7 +99,7 @@ describe('fromfilePrefixchars', function () {
/ENOENT, no such file or directory/
);
});
- it('Test reading arguments from an missing file', function () {
+ it('test reading arguments from an missing file', function () {
assert.throws(
function () {
args = parser.parseArgs(['@missing']);
@@ -107,7 +107,7 @@ describe('fromfilePrefixchars', function () {
/ENOENT, no such file or directory/
);
});
- it('Test custom convertArgLineToArgs function', function () {
+ it('test custom convertArgLineToArgs function', function () {
parser.convertArgLineToArgs = function (argLine) {
// split line into 'words'
args = argLine.split(' ');
Please sign in to comment.
Something went wrong with that request. Please try again.