From f35ccbcd30e4a4c910e221611f79c1158e1cfaee Mon Sep 17 00:00:00 2001 From: harveyshao Date: Fri, 16 Jul 2021 16:59:32 +0800 Subject: [PATCH] opt bash --- plugin/state.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/state.js b/plugin/state.js index 2a3f123d..f905722d 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -17,11 +17,12 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, conf, return true }, _field: function(can, msg) { - msg.Table(function(item) { can.onappend._plugin(can, item, {arg: can.base.Obj(msg.Option("arg"), [])}, function(sub, meta) { + msg.Table(function(item) { can.onappend._plugin(can, item, {arg: can.base.Obj(item["arg"], [])}, function(sub, meta) { + var opt = can.base.Obj(item["opt"], []) sub.run = function(event, cmds, cb, silent) { var res = can.request(event); can.core.Item(can.Option(), function(key, value) { res.Option(key) || res.Option(key, value) - }) + }); for (var i = 0; i < opt.length; i += 2) { res.Option(opt[i], opt[i+1]) } can.run(event, (msg["_prefix"]||[]).concat(cmds), cb, true) } }) })