summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMarkus Grueneis <gimpf@spreadspace.org>2010-11-24 00:51:03 +0000
committerMarkus Grueneis <gimpf@spreadspace.org>2010-11-24 00:51:03 +0000
commit727471067c25f14e5ef5b05ee0107a25c069fad9 (patch)
treeaebb791c75cd0dd5a1f02df17452231768b418ac /examples
parentadded cleanup function to exec child (diff)
implemented dispatch-table
added example dispatch-table table... using dispatcher in stdio and exec module git-svn-id: https://svn.spreadspace.org/gcsd/trunk@58 ac14a137-c7f1-4531-abe0-07747231d213
Diffstat (limited to 'examples')
-rw-r--r--examples/simple_dispatcher.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/simple_dispatcher.lua b/examples/simple_dispatcher.lua
new file mode 100644
index 0000000..5a931e3
--- /dev/null
+++ b/examples/simple_dispatcher.lua
@@ -0,0 +1,6 @@
+return {
+ ["%w+%s*"] = function(match)
+ local cmd = string.match("(%w+)%s*", match)
+ command_queue:enqueue_command(cmd)
+ end
+} \ No newline at end of file