Add programatic returns to commands
This commit is contained in:
parent
d83d268e80
commit
299309735a
@ -36,6 +36,7 @@ local function cmd(args)
|
|||||||
table.insert(entries.children,entry)
|
table.insert(entries.children,entry)
|
||||||
env.changed = true
|
env.changed = true
|
||||||
print(entry.attrs.id)
|
print(entry.attrs.id)
|
||||||
|
return entry
|
||||||
end
|
end
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
local function cmd(args)
|
local function cmd(args)
|
||||||
|
local rtn = {}
|
||||||
local entries = env.xmlFindTags(env.db,"entries")[1]
|
local entries = env.xmlFindTags(env.db,"entries")[1]
|
||||||
entries = env.xmlFindTags(entries,"entry")
|
entries = env.xmlFindTags(entries,"entry")
|
||||||
for i,entry in pairs(entries) do
|
for i,entry in pairs(entries) do
|
||||||
if (entry.attrs.removed ~= "true") then
|
if (entry.attrs.removed ~= "true") then
|
||||||
print(entry.attrs.id .. " " ..entry.attrs.date.. " " ..entry.attrs.name)
|
print(entry.attrs.id .. " " ..entry.attrs.date.. " " ..entry.attrs.name)
|
||||||
|
table.insert(rtn,entry)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return rtn
|
||||||
end
|
end
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
|
@ -5,6 +5,7 @@ local function cmd(args)
|
|||||||
for i,v in pairs(env.xmlFindTags(v,"fields")[1].children) do
|
for i,v in pairs(env.xmlFindTags(v,"fields")[1].children) do
|
||||||
if v.attrs.name == args[3] then
|
if v.attrs.name == args[3] then
|
||||||
print(v.children[1].text)
|
print(v.children[1].text)
|
||||||
|
return v.children[1].text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,6 +5,7 @@ local function cmd(args)
|
|||||||
for i,v in pairs(env.xmlFindTags(v,"fields")[1].children) do
|
for i,v in pairs(env.xmlFindTags(v,"fields")[1].children) do
|
||||||
if v.attrs.name == args[3] then
|
if v.attrs.name == args[3] then
|
||||||
print(v.attrs.type)
|
print(v.attrs.type)
|
||||||
|
return v.attrs.type
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
local function cmd(args)
|
local function cmd(args)
|
||||||
local entries = env.xmlFindTags(env.db,"entries")[1]
|
local entries = env.xmlFindTags(env.db,"entries")[1]
|
||||||
|
local rtn = {}
|
||||||
for i,v in pairs(entries.children) do
|
for i,v in pairs(entries.children) do
|
||||||
if v.attrs.id == args[2] and not v.attrs.deleted then
|
if v.attrs.id == args[2] and not v.attrs.deleted then
|
||||||
for i,v in pairs(env.xmlFindTags(v,"fields")[1].children) do
|
for i,v in pairs(env.xmlFindTags(v,"fields")[1].children) do
|
||||||
print(v.attrs.name)
|
print(v.attrs.name)
|
||||||
|
table.insert(rtn,v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return rtn
|
||||||
end
|
end
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
|
Loading…
Reference in New Issue
Block a user