1
0
mirror of https://github.com/natnat-mc/moonbuild synced 2026-05-28 08:29:40 +02:00

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

This commit is contained in:
Codinget
2020-12-01 21:33:59 +01:00
parent 0f3506c7b7
commit d43e9350d3
2 changed files with 17 additions and 1 deletions
+7 -1
View File
@@ -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'}
+10
View File
@@ -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