blob: 907d1482b9234ce8fa10510a950ba62effd1a4c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-- examples/list-migration.lua
--
-- Example of list migration capability of Clod
--
-- Copyright 2012 Daniel Silverstone <dsilvers@digital-scurf.org>
--
clod = require "clod"
local configuration = [[
description = "Gitano Alpha Testers"
members = {
"dsilvers",
"liw",
}
subgroups {
}
]]
conf, err = clod.parse(configuration, "@config", true)
if not conf then
error(err)
end
print("Group description is", conf.settings.description)
local members = conf:get_list("members")
print("There are", #members, "members")
for i = 1, #members do
print(members[i])
end
local subgroups = conf:get_list("subgroups")
print("There are", #subgroups, "sub-groups")
|