remove manual main definitions

This commit is contained in:
2021-07-25 21:10:15 -06:00
parent d7ff5fc9c2
commit 3fa3439a1d
2 changed files with 39 additions and 44 deletions

View File

@@ -1,18 +1,18 @@
// External programs can load Lib.kiss with (loadFrom "nat-archive-tool" "src/nat/Lib.kiss")
(load "Lib.kiss")
(function :Void main []
(let [[archiveDir] (Sys.args)
controller
(new ArchiveController
(new Archive archiveDir)
(new CLI))]
(loop
(Sys.print ">> ")
(let [command
(.trim (.toString (.readLine (Sys.stdin))))]
(if (controller.commands.exists command)
(controller.runCommand (dictGet controller.commands command))
(Sys.println "$command is not a valid command"))))))
(let [[archiveDir] (Sys.args)
controller
(new ArchiveController
(new Archive archiveDir)
(new CLI))]
(loop
(Sys.print ">> ")
(let [command
(.trim (.toString (.readLine (Sys.stdin))))]
(if (controller.commands.exists command)
(controller.runCommand (dictGet controller.commands command))
(Sys.println "$command is not a valid command")))))
(defNew [])