calc.lua 434 B

12345678910111213141516171819
  1. VERSION = "1.0.0"
  2. local micro = import("micro")
  3. local config = import("micro/config")
  4. local shell = import("micro/shell")
  5. local strings = import("strings")
  6. function init()
  7. config.MakeCommand("calc", calc, config.OptionComplete)
  8. config.AddRuntimeFile("calc", config.RTPlugin, "calc.lua")
  9. end
  10. function calc(buffer_pane, args)
  11. args = strings.Join(args," ")
  12. out = shell.ExecCommand("calc", args)
  13. micro.InfoBar():Message(out)
  14. end