diff --git a/app/cmd/cmd.js b/app/cmd/cmd.js index 0741fc0..ab46584 100644 --- a/app/cmd/cmd.js +++ b/app/cmd/cmd.js @@ -8,7 +8,7 @@ app.compose(function() { return { execute: function(rawInput) { - var input = rawInput.trim(); + var input = rawInput.trim().toLowerCase(); var handler = this.findHandler(input); if(handler != null) { @@ -82,6 +82,9 @@ app.compose(function() { displayCommandError: function (input, message) { var error = new app.models.ErrorResult(message); cmdController.display(new app.models.DisplayResult(input, error)); + }, + clear: function() { + cmdController.clear(); } }; }); diff --git a/app/cmd/commands.js b/app/cmd/commands.js index 0311b49..6d3b405 100644 --- a/app/cmd/commands.js +++ b/app/cmd/commands.js @@ -2,6 +2,7 @@ app.run(function() { "use strict"; var cmd = app.get('cmd'); + var cmdConfig = app.get('cmdConfig'); cmd.commands({ 'help': function() { @@ -13,11 +14,10 @@ app.run(function() { return new app.models.HelpResult(); }, 'clear': function() { - app.controller('cmdController').clear(); + cmd.clear(); }, 'em': function() { - var cfg = app.get('cmdConfig'); - cfg.emphasizeBytes = !cfg.emphasizeBytes; + cmdConfig.emphasizeBytes = !cmdConfig.emphasizeBytes; } }); diff --git a/index.html b/index.html index f6c77c3..9ae4a8c 100644 --- a/index.html +++ b/index.html @@ -44,7 +44,7 @@