local config = nil
local print_help = function()
- print("> start engine_name\n starts engine_name")
- print("> stop engine_name\n stopts engine_name")
- print("> status [engine_name]\n prints status")
- print("> exit\n exits program")
- print("> help, ?\n prints help")
+ local format = function(cmd,desc)
+ term.setTextColor(1)
+ print("> "..cmd)
+ term.setTextColor(256)
+ print(" "..desc)
+ end
+ f("start engine_name" , "starts engine_name")
+ f("stop engine_name" , "stopts engine_name")
+ f("status [engine_name]" , "prints status")
+ f("exit" , "exits program")
+ f("help, ?" , "prints help")
end
local start_engine = function(engine)
local main = function()
local running = true
+ print("type \"help\" or \"?\" for help")
local case =
{ ["test"] = function(a)
print("testing, one two, one two!")
}
while running do
+ term.setTextColor(64)
+ term.write("> ")
+ term.setTextColor(1)
local cmd, arg = parse_command(read())
for c,f in pairs(case) do
if cmd == c then f(arg); break end
if fs.exists(config_path) then
config = dofile("simple-coal-feeder.config")
+ -- todo: check config validity
main()
else
print("No configuration!")
+ print("See executable for help configuring")
end