aboutsummaryrefslogtreecommitdiffstats
path: root/init.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-02-03 10:59:10 +0000
committers-ol <s-ol@users.noreply.github.com>2020-02-03 11:00:32 +0000
commit1b6da2babfc65c4b8f6f7ac8644c0498e094bab7 (patch)
tree61ef0fc20c511cd8936e6af2d889a2ffddab9211 /init.moon
parentfix error handling again (diff)
downloadalive-1b6da2babfc65c4b8f6f7ac8644c0498e094bab7.tar.gz
alive-1b6da2babfc65c4b8f6f7ac8644c0498e094bab7.zip
Forward references
Diffstat (limited to 'init.moon')
-rw-r--r--init.moon15
1 files changed, 13 insertions, 2 deletions
diff --git a/init.moon b/init.moon
index 423bdda..0603c5b 100644
--- a/init.moon
+++ b/init.moon
@@ -4,7 +4,18 @@ import Logger from require 'logger'
import Registry from require 'registry'
import Copilot from require 'copilot'
-Logger.init!
+arguments, key = {}
+for a in *arg
+ if match = a\match '^%-%-(.*)'
+ key = match
+ arguments[key] = true
+ elseif key
+ arguments[key] = a
+ key = nil
+ else
+ table.insert arguments, a
+
+Logger.init arguments.log
delta = do
gettime = ->
@@ -18,7 +29,7 @@ delta = do
last = time
env = Registry!
-copilot = Copilot arg[1], env
+copilot = Copilot arguments[1], env
while true
copilot\poll!