Commit 75bd6a3d authored by yann300's avatar yann300

add batch command

parent 8ecf9439
'use strict' 'use strict'
var remix = require('ethereum-remix') var remixLib = require('remix-lib')
var EventManager = remix.lib.EventManager var EventManager = remixLib.EventManager
class CmdInterpreter { class CmdInterpreter {
constructor () { constructor () {
...@@ -10,13 +10,15 @@ class CmdInterpreter { ...@@ -10,13 +10,15 @@ class CmdInterpreter {
if (!cmd) return false if (!cmd) return false
var accept = commandsRegEx.exec(cmd) var accept = commandsRegEx.exec(cmd)
if (accept) { if (accept) {
this.event.trigger(accept[1], [cmd.replace(commandsRegEx, '')]) var param = accept[2]
if (param) param = param.trim()
this.event.trigger(accept[1], [param])
return accept[1] return accept[1]
} }
return null return null
} }
} }
var commandsRegEx = /^remix:(debug|loadgist|setproviderurl|loadswarm)\s/ var commandsRegEx = /^remix:(debug|loadgist|setproviderurl|loadurl|batch)(.*)/
module.exports = CmdInterpreter module.exports = CmdInterpreter
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