diff options
-rw-r--r-- | ClientHamr/GuiLua/test.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ClientHamr/GuiLua/test.lua b/ClientHamr/GuiLua/test.lua index fdb1448..e1e2de8 100644 --- a/ClientHamr/GuiLua/test.lua +++ b/ClientHamr/GuiLua/test.lua | |||
@@ -1,6 +1,5 @@ | |||
1 | -- Wrapping the entire module in do .. end helps if people just join a bunch of modules together, which apparently is popular. | 1 | -- Wrapping the entire module in do .. end helps if people just join a bunch of modules together, which apparently is popular. |
2 | -- By virtue of the fact we are stuffing our result into package.loaded[], just plain running this works as "loading the module". | 2 | -- By virtue of the fact we are stuffing our result into package.loaded[], just plain running this works as "loading the module". |
3 | -- TODO - Except for the "passing the name in as ..." part. B-( | ||
4 | do -- Only I'm not gonna indent this. | 3 | do -- Only I'm not gonna indent this. |
5 | 4 | ||
6 | local skang = require 'skang' | 5 | local skang = require 'skang' |
@@ -35,7 +34,7 @@ skang.newParam(_M, 'bar', "Required", "Shortcut", "Default", "Help text") | |||
35 | 34 | ||
36 | -- We can use inline functions if we don't need the function internally. | 35 | -- We can use inline functions if we don't need the function internally. |
37 | skang.newCommand(_M, 'func', 'number,data', 'Help Text', function (arg1, arg2) | 36 | skang.newCommand(_M, 'func', 'number,data', 'Help Text', function (arg1, arg2) |
38 | -- do something here | 37 | print('Inside test.func ' .. arg1 .. ', ' .. arg2) |
39 | end) | 38 | end) |
40 | 39 | ||
41 | 40 | ||
@@ -48,5 +47,7 @@ end | |||
48 | 47 | ||
49 | -- Test it. | 48 | -- Test it. |
50 | local skang = require 'skang' | 49 | local skang = require 'skang' |
51 | local test = package.loaded['test'] | 50 | local test = require 'test' |
52 | print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.ThingSpace.commands.func.help) | 51 | print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.ThingSpace.commands.func.help) |
52 | test.func('one', 2) | ||
53 | skang.ThingSpace.commands.func.func(3, 'four') | ||