add getArgTypes command

Which allows you to see what arguments you need to pass to a function.
This commit is contained in:
Ryan X. Charles 2014-04-15 09:19:07 -03:00
parent cba3487988
commit 4773b6577a
1 changed files with 18 additions and 0 deletions

View File

@ -84,6 +84,24 @@ Copay.prototype.getBalance.argTypes =
];
*/
Copay.prototype.getArgTypes = function getArgTypes(command, callback) {
var self = this;
checkArgs(arguments.callee.name, arguments);
if (command[0] == '_' || typeof Copay.prototype[command] != 'function')
return callback(new Error('Invalid command'));
var argTypes = Copay.prototype[command].argTypes;
return callback(null, argTypes);
};
Copay.prototype.getArgTypes.argTypes =
[
['command', 'string'],
['callback', 'function']
];
Copay.prototype.getCommands = function getCommands(callback) {
var self = this;
checkArgs(arguments.callee.name, arguments);