30 lines
715 B
TypeScript
Executable File
30 lines
715 B
TypeScript
Executable File
#! /usr/bin/env bun
|
|
|
|
export async function main() {
|
|
const cmd = Bun.argv[2]
|
|
switch (cmd) {
|
|
case "listen": {
|
|
const {listen} = await import("./listener")
|
|
return listen()
|
|
}
|
|
case "send": {
|
|
const {send} = await import("./sender")
|
|
return send ()
|
|
}
|
|
case "run": {
|
|
const {run_file} = await import("./runner")
|
|
return run_file(Bun.argv[3])
|
|
}
|
|
case "help": { return console.log(help_text) }
|
|
case "version": { return console.log("0.1.0") }
|
|
default: console.log("Usage: ludus {help | version | run | listen | send}")
|
|
}
|
|
}
|
|
|
|
async function help_text() {
|
|
const help_text = await Bun.file("./help.txt").text()
|
|
console.log(help_text)
|
|
}
|
|
|
|
await main()
|