git.s-ol.nu alive / v0.1-rc4 bin / alv
v0.1-rc4

Tree @v0.1-rc4 (Download .tar.gz)

alv @v0.1-rc4raw · history · blame

#!/usr/bin/env moon
import Copilot, Logger from require 'alv'
import sleep from require 'system'

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

assert arguments[1], "no filename given"
copilot = Copilot arguments[1]

while true
  copilot\tick!
  sleep 1 / 1000