From 4a4dfc1dd0148c15e8cf37b2e85d6a7e8fd3ea86 Mon Sep 17 00:00:00 2001 From: Guy Zana <guy@cloudius-systems.com> Date: Mon, 3 Jun 2013 13:29:22 +0300 Subject: [PATCH] run.js: ditch 'run' from arguments in invoke() instead run() run_cmd.run() is an internal function that can be used by the rest of the cli. --- console/run.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/console/run.js b/console/run.js index 1c2a1efef..f5b91599c 100644 --- a/console/run.js +++ b/console/run.js @@ -8,12 +8,10 @@ var run_cmd = { }, run: function(argv) { - if (argv.length < 2) { + if (argv.length < 1) { return -1; } - argv.splice(0, 1); - var f = null; if (argv[0].indexOf("/") == 0) { f = File(argv[0]); @@ -37,6 +35,13 @@ var run_cmd = { }, invoke: function(inp) { + if (inp.length < 2) { + return; + } + + // ditch 'run' + inp.splice(0, 1); + rc = this.run(inp); if (rc < 0) { print("run: couldn't execute elf"); -- GitLab