fix descriptions a bit and sort the slash commands when tab-completing

This commit is contained in:
Matthew Hodgson 2016-01-14 16:29:30 +00:00
parent 84a7fc1640
commit 42dc1be341

View file

@ -69,7 +69,7 @@ var commands = {
}), }),
// Changes the colorscheme of your current room // Changes the colorscheme of your current room
tint: new Command("tint", "<primaryColor> [<secondaryColor>]", function(room_id, args) { tint: new Command("tint", "<color1> [<color2>]", function(room_id, args) {
if (args) { if (args) {
var matches = args.match(/^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}))( +(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})))?$/); var matches = args.match(/^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}))( +(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})))?$/);
if (matches) { if (matches) {
@ -89,7 +89,7 @@ var commands = {
return reject(this.getUsage()); return reject(this.getUsage());
}), }),
encrypt: new Command("encrypt", "<on/off>", function(room_id, args) { encrypt: new Command("encrypt", "<on|off>", function(room_id, args) {
if (args == "on") { if (args == "on") {
var client = MatrixClientPeg.get(); var client = MatrixClientPeg.get();
var members = client.getRoom(room_id).currentState.members; var members = client.getRoom(room_id).currentState.members;
@ -354,7 +354,7 @@ module.exports = {
}, },
getCommandList: function() { getCommandList: function() {
return Object.keys(commands).map(function(cmdKey) { return Object.keys(commands).sort().map(function(cmdKey) {
return commands[cmdKey]; return commands[cmdKey];
}); });
} }