added _.cmdline and _.cmdlinerst, closes #20

main
Codinget 4 years ago
parent 0f3506c7b7
commit d43e9350d3
  1. 8
      moonbuild/_cmd.moon
  2. 10
      out/moonbuild.lua

@ -17,5 +17,11 @@ cmd.backend = backend
cmd.parseargs = parseargs
cmd.escape = escape
-- derived cmd functions
_cmd = cmd.cmd
_cmdrst = cmd.cmdrst
cmd.cmdline = (cmdline) -> _cmd parseargs cmdline
cmd.cmdlinerst = (cmdline) -> _cmdrst parseargs cmdline
-- the library itself
setmetatable cmd, __call: => {'cmd', 'cmdrst', 'sh'}
setmetatable cmd, __call: => {'cmd', 'cmdrst', 'cmdline', 'cmdlinerst', 'sh'}

@ -69,11 +69,21 @@ end
cmd.backend = backend
cmd.parseargs = parseargs
cmd.escape = escape
local _cmd = cmd.cmd
local _cmdrst = cmd.cmdrst
cmd.cmdline = function(cmdline)
return _cmd(parseargs(cmdline))
end
cmd.cmdlinerst = function(cmdline)
return _cmdrst(parseargs(cmdline))
end
return setmetatable(cmd, {
__call = function(self)
return {
'cmd',
'cmdrst',
'cmdline',
'cmdlinerst',
'sh'
}
end

Loading…
Cancel
Save