From c85355947228b02d1e353c29530b185967ea86fe Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Thu, 23 Aug 2012 21:53:46 +0100 Subject: EXAMPLE: Demonstrate additions to settings --- examples/change-setting.lua | 6 ++++++ 1 file changed, 6 insertions(+) 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()) -- cgit v1.2.1