summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-08-23 21:53:46 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-08-23 21:53:46 +0100
commitc85355947228b02d1e353c29530b185967ea86fe (patch)
treed0cf76c23ef1c72c6dcb05be1419d9de6a1cf1f8
parentc95414f012dfeb2a87090866c68a61e08b87c0f0 (diff)
downloadclod-c85355947228b02d1e353c29530b185967ea86fe.tar.gz
EXAMPLE: Demonstrate additions to settings
-rw-r--r--examples/change-setting.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/change-setting.lua b/examples/change-setting.lua
index 1c26545..13914d1 100644
--- a/examples/change-setting.lua
+++ b/examples/change-setting.lua
@@ -27,6 +27,12 @@ conf.settings.project.head = "refs/heads/master"
conf.settings.project.description = "Demonstration of settings"
-- Remove other.thing (will also elide trailing blank line)
conf.settings.other.thing = nil
+-- And add a new setting which will add a blank line.
+-- Note, that we cannot use conf.settings.person.name here because
+-- the '.person.' will return nil as there is no such prefix.
+conf.settings["person.name"] = "Lars"
+-- Although now we can do this:
+conf.settings.person.age = 42
io.stdout:write(conf:serialise())