CommandManager.defineCommands Member

Adds multiple commands in a single call.

Syntax

object.defineCommands(cmdary);

Arguments

ArgumentSummary
cmdaryArray containing commands to define; each item in the Array is also an Array, with either 3 or 4 items - corresponding to the first three or four arguments of defineCommand. An extra property, stringBundle, may be set on the cmdaryArray to override the defaultBundle for all the commands.

Returns

Remarks

See Also

Source Code

function cmgr_defcmds(cmdary)
{
var len = cmdary.length;
var commands = new Object();
var bundle = "stringBundle" in cmdary ? cmdary.stringBundle : null;
for (var i = 0; i < len; ++i)
{
var name = cmdary[i][0];
var func = cmdary[i][1];
var flags = cmdary[i][2];
var usage;
if (3 in cmdary[i])
usage = cmdary[i][3];
var command = this.defineCommand(name, func, flags, usage, bundle);
commands[name] = command;
}
return commands;
}