Permalink
Browse files

Updated documentation

  • Loading branch information...
1 parent c110df0 commit 8e9f30dcf77c084e138d96196190d977f763efdb @arikon arikon committed Sep 27, 2011
Showing with 16 additions and 4 deletions.
  1. +8 −0 README.md
  2. +2 −1 lib/cmd.js
  3. +2 −1 lib/opt.js
  4. +2 −1 src/cmd.coffee
  5. +2 −1 src/opt.coffee
View
8 README.md
@@ -114,6 +114,9 @@ and run ahead current program, i.e. call process.exit when all actions done.
#### Cmd.reject
Return reject of actions results promise.<br>
Use in .act() for return with error.<br>
+**@param** *Object* `reason` reject reason<br>
+ You can customize toString() method and exitCode property
+ of reason object.<br>
**@returns** *Q.promise* rejected promise
#### Cmd.end
@@ -159,6 +162,11 @@ Otherwise, the value will be used by the latter passed.<br>
Makes an option req.<br>
**@returns** *COA.Opt* `this` instance (for chainability)
+#### Opt.only
+Makes an option to act as a command,
+i.e. program will exit just after option action.<br>
+**@returns** *COA.Opt* `this` instance (for chainability)
+
#### Opt.val
Set a validation (or value) function for argument.<br>
Value from command line passes through before becoming available from API.<br>
View
3 lib/cmd.js
@@ -294,7 +294,8 @@ exports.Cmd = Cmd = (function() {
Return reject of actions results promise with error code.
Use in .act() for return with error.
@param {Object} reject reason
- @param {Integer} error code
+ You can customize toString() method and exitCode property
+ of reason object.
@returns {Q.promise} rejected promise
*/
Cmd.prototype.reject = function(reason) {
View
3 lib/opt.js
@@ -75,7 +75,8 @@ exports.Opt = Opt = (function() {
return this;
};
/**
- Makes an option to act as a command.
+ Makes an option to act as a command,
+ i.e. program will exit just after option action.
@returns {COA.Opt} this instance (for chainability)
*/
Opt.prototype.only = function() {
View
3 src/cmd.coffee
@@ -270,7 +270,8 @@ exports.Cmd = class Cmd
Return reject of actions results promise with error code.
Use in .act() for return with error.
@param {Object} reject reason
- @param {Integer} error code
+ You can customize toString() method and exitCode property
+ of reason object.
@returns {Q.promise} rejected promise
###
reject: (reason) -> Q.reject(reason)
View
3 src/opt.coffee
@@ -70,7 +70,8 @@ exports.Opt = class Opt
@
###*
- Makes an option to act as a command.
+ Makes an option to act as a command,
+ i.e. program will exit just after option action.
@returns {COA.Opt} this instance (for chainability)
###
only: ->

0 comments on commit 8e9f30d

Please sign in to comment.