Commit 57d1cacf authored by Eirik Alvær's avatar Eirik Alvær
Browse files

fixes errors

parent 3995f200
...@@ -195,13 +195,11 @@ function CommandExecutor() { ...@@ -195,13 +195,11 @@ function CommandExecutor() {
}); });
}; };
function addHelpCommands(helpText) { var helpCommands = Object.keys(helpTexts);
var helpCommands = helpTexts.keys(); helpCommands.sort();
helpCommands.sort(); helpCommands.forEach(function (helpCommand) {
helpCommands.forEach(function (helpCommand) { helpTexts.help.description += " " + helpCommand;
helpText.description += " " + helpCommand; });
});
}
return { return {
//Eww! This method should not be exported, but it has to be done to //Eww! This method should not be exported, but it has to be done to
...@@ -221,10 +219,7 @@ function CommandExecutor() { ...@@ -221,10 +219,7 @@ function CommandExecutor() {
switch (parserObject.type) { switch (parserObject.type) {
case "help": case "help":
helpText = helpTexts[parserObject.helpTopic]; helpText = helpTexts[parserObject.helpTopic || "help"];
if (parserObject.helpTopic === "help") {
addHelpCommands(helpText);
}
intermediateResult = new Promise(function (resolve) { intermediateResult = new Promise(function (resolve) {
resolve(helpText ? resolve(helpText ?
{result: helpText} : {result: helpText} :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment