You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
450 B
21 lines
450 B
'use strict';
|
|
|
|
module.exports = function(usage, description, init, aliases) {
|
|
if (Array.isArray(init)) {
|
|
aliases = init;
|
|
init = undefined;
|
|
}
|
|
if (aliases && Array.isArray(aliases)) {
|
|
usage = [].concat([usage], aliases);
|
|
}
|
|
|
|
// Register command to global scope
|
|
this.details.commands.push({
|
|
usage,
|
|
description,
|
|
init: typeof init === 'function' ? init : false
|
|
});
|
|
|
|
// Allow chaining of .command()
|
|
return this;
|
|
};
|
|
|