summaryrefslogtreecommitdiff
path: root/examples/simple-config-reader.lua
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-08-23 11:12:03 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-08-23 11:12:03 +0100
commit11243f851382e3618f05b6c4dd8a937c0c820ee0 (patch)
tree8a14a72c50676f8751c82f611f059a0e5342dd08 /examples/simple-config-reader.lua
parentd2f52487f795ab3c0c5bd8074b5a6c9177f8fbb3 (diff)
downloadclod-11243f851382e3618f05b6c4dd8a937c0c820ee0.tar.gz
Initial examples, not all work
Diffstat (limited to 'examples/simple-config-reader.lua')
-rw-r--r--examples/simple-config-reader.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/simple-config-reader.lua b/examples/simple-config-reader.lua
new file mode 100644
index 0000000..b1b4719
--- /dev/null
+++ b/examples/simple-config-reader.lua
@@ -0,0 +1,18 @@
+-- examples/simple-config-reader.lua
+--
+-- Simple configuration reader which interrogates only specific keys
+--
+-- Copyright 2012 Daniel Silverstone <dsilvers@digital-scurf.org>
+--
+
+clod = require "clod"
+
+local configuration = [[
+project.name "Clod"
+project.head "refs/heads/master"
+]]
+
+conf = clod.parse(configuration)
+
+print("Project name is", conf.settings["project.name"])
+print("Project HEAD is", conf.settings.project.head)