diff options
author | Adrian Kummerlaender | 2015-08-12 20:18:09 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2015-08-12 20:18:09 +0200 |
commit | 2cbab1bd52ebdc6dae1f3ba63903b107cfd674be (patch) | |
tree | 32f342a98e67136eaf742e9818f0b7b55262bbe1 /qml/commands.js | |
parent | 610cc9d77f89ab106fdbfbc006934c9d192a55a8 (diff) | |
download | MetaTerm-2cbab1bd52ebdc6dae1f3ba63903b107cfd674be.tar MetaTerm-2cbab1bd52ebdc6dae1f3ba63903b107cfd674be.tar.gz MetaTerm-2cbab1bd52ebdc6dae1f3ba63903b107cfd674be.tar.bz2 MetaTerm-2cbab1bd52ebdc6dae1f3ba63903b107cfd674be.tar.lz MetaTerm-2cbab1bd52ebdc6dae1f3ba63903b107cfd674be.tar.xz MetaTerm-2cbab1bd52ebdc6dae1f3ba63903b107cfd674be.tar.zst MetaTerm-2cbab1bd52ebdc6dae1f3ba63903b107cfd674be.zip |
Add special error formatting to command output
Diffstat (limited to 'qml/commands.js')
-rw-r--r-- | qml/commands.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/qml/commands.js b/qml/commands.js index b116b23..765a747 100644 --- a/qml/commands.js +++ b/qml/commands.js @@ -1,27 +1,27 @@ function execute(output, command) { - var msg = function(name) { - output.log('"' + name + '"' + " is not implemented."); + var notImplemented = function(name) { + output.error('"' + name + '"' + ' is not implemented.'); }; var args = command.split(' '); try { var closure = eval(args[0]); - if ( typeof closure === "function" ) { + if ( typeof closure === 'function' ) { args.shift(); closure(output, args); } else { - msg(args[0]); + notImplemented(args[0]); } } catch (exception) { - msg(args[0]); + notImplemented(args[0]); } } function exec(output, args) { var result = eval(args.join(' ')); - if ( typeof result !== "undefined" ) { + if ( typeof result !== 'undefined' ) { output.log(result); } else { output.log(''); |