aboutsummaryrefslogtreecommitdiffstats
path: root/bin/alv
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-05-15 11:22:56 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:24:49 +0000
commitdceb06938c1295d1a4a7eafff20d5007e48dab81 (patch)
tree5984aa544f188d4033fda2b40c91e4a10005f4a8 /bin/alv
parentadd array and struct constructors (diff)
downloadalive-dceb06938c1295d1a4a7eafff20d5007e48dab81.tar.gz
alive-dceb06938c1295d1a4a7eafff20d5007e48dab81.zip
move copilot logic, make startup scripts lua
Diffstat (limited to 'bin/alv')
-rwxr-xr-xbin/alv40
1 files changed, 4 insertions, 36 deletions
diff --git a/bin/alv b/bin/alv
index 272cac3..f01b90c 100755
--- a/bin/alv
+++ b/bin/alv
@@ -1,36 +1,4 @@
-#!/usr/bin/env moon
-import Copilot, Logger from require 'alv'
-import sleep from require 'system'
-
-class ColorLogger extends Logger
- set_time: (time) =>
- super time
- @stream\write switch time
- when 'eval' then '\27[92m'
- when 'run' then '\27[0m'
-
-arguments, key = { nocolor: false }
-for a in *arg
- if key
- arguments[key] = a
- key = nil
- else if match = a\match '^%-%-(.*)'
- if 'bool' == type arguments[key]
- arguments[key] = true
- else
- key = match
- else
- table.insert arguments, a
-assert not key, "option value missing"
-
-if arguments.nocolor
- Logger\init arguments.log
-else
- ColorLogger\init arguments.log
-
-assert arguments[1], "no filename given"
-copilot = Copilot arguments[1]
-
-while true
- copilot\tick!
- sleep 1 / 1000
+#!/usr/bin/env lua
+require('moonscript')
+local Copilot = require('alv.copilot.cli').CLICopilot
+Copilot(arg):run()