Permalink
Browse files

'printFunc' -> printer

  • Loading branch information...
1 parent 61243a0 commit c6f39f1d0e7f283a4ec969b18f43be00796f0c2a @harthur committed Nov 2, 2011
Showing with 16 additions and 16 deletions.
  1. +1 −1 README.md
  2. +1 −1 nomnom.js
  3. +1 −1 test/callback.js
  4. +5 −5 test/commands.js
  5. +3 −3 test/expected.js
  6. +5 −5 test/usage.js
View
@@ -237,7 +237,7 @@ A string that is appended to the usage.
Nomnom can't detect the alias used to run your script. You can use `scriptName` to provide the correct name for the usage printout instead of e.g. `node test.js`.
-#### printFunc
+#### printer
Overrides the usage printing function.
View
@@ -58,7 +58,7 @@ ArgParser.prototype = {
return this;
},
- printFunc : function(print) {
+ printer : function(print) {
this.print = print;
return this;
},
View
@@ -25,7 +25,7 @@ exports.testReturnString = function(test) {
}
}
})
- .printFunc(function(string) {
+ .printer(function(string) {
test.equal(0, string.indexOf("v0.3"))
test.done();
})
View
@@ -26,7 +26,7 @@ exports.testMissingCommand = function(test) {
parser.command('run');
- parser.printFunc(function(string) {
+ parser.printer(function(string) {
test.equal(string, "test: no such command 'other'");
test.done();
});
@@ -91,27 +91,27 @@ exports.testUsage = function(test) {
test.expect(4);
var parser = createParser();
- parser.printFunc(function(string) {
+ parser.printer(function(string) {
test.equal(strip(string), "testusage");
});
parser.parseArgs(["test", "-h"]);
parser = createParser();
- parser.printFunc(function(string) {
+ parser.printer(function(string) {
test.equal(strip(string), "usage:testrun[options]options:--debug--filefiletorunrunall");
});
parser.parseArgs(["run", "-h"]);
parser = createParser();
- parser.printFunc(function(string) {
+ parser.printer(function(string) {
test.equal(strip(string), "usage:test<command>[options]commandoneof:run,testoptions:--debug--verbosenocommand");
});
parser.parseArgs(["-h"]);
parser = createParser();
parser.nocommand()
.usage("fallback");
- parser.printFunc(function(string) {
+ parser.printer(function(string) {
test.equal(strip(string), "fallback");
});
parser.parseArgs(["-h"]);
View
@@ -17,7 +17,7 @@ exports.testFlag = function(test) {
position: 0,
}
})
- .printFunc(function(string) {
+ .printer(function(string) {
test.equal(0, string.indexOf("'--key1' expects a value"))
test.done();
})
@@ -32,7 +32,7 @@ exports.testRequired = function(test) {
required: true
}
})
- .printFunc(function(string) {
+ .printer(function(string) {
test.equal(0, string.indexOf("file argument is required"))
test.done();
})
@@ -47,7 +47,7 @@ exports.testChoices = function(test) {
choices: ['green', 'blue']
}
})
- .printFunc(function(string) {
+ .printer(function(string) {
test.equal(0, string.indexOf("color must be one of: green, blue"))
});
View
@@ -35,7 +35,7 @@ var expected = "usage:test<egg>[options]eggrobinoptions:-a,--applehowmanyapples-
exports.testH = function(test) {
test.expect(1);
- parser.printFunc(function(string) {
+ parser.printer(function(string) {
test.equal(strip(string), expected)
test.done();
})
@@ -45,7 +45,7 @@ exports.testH = function(test) {
exports.testHelp = function(test) {
test.expect(1);
- parser.printFunc(function(string) {
+ parser.printer(function(string) {
test.equal(strip(string), expected)
test.done();
})
@@ -57,7 +57,7 @@ exports.testScriptName = function(test) {
nomnom()
.scriptName("test")
- .printFunc(function(string) {
+ .printer(function(string) {
test.equal(strip(string),"usage:test")
test.done();
})
@@ -69,7 +69,7 @@ exports.testUsage = function(test) {
parser
.usage("test usage")
- .printFunc(function(string) {
+ .printer(function(string) {
test.equal(string, "test usage")
test.done();
})
@@ -85,7 +85,7 @@ exports.testHidden = function(test) {
}
})
.scriptName("test")
- .printFunc(function(string) {
+ .printer(function(string) {
test.equal(strip("usage:test[options]options:"), strip(string))
test.done();
})

0 comments on commit c6f39f1

Please sign in to comment.