Implements a repl, accessed by pressing enter. There are a few basic commands accessible atm the idea being that most commands would be project specific. It's straightforward to add more commands. Sample from Spookfile:
-- the function given to the shell is the prompt, it's meant to be a function that is evaluated on every refresh
:repl, :cmdline = require('shell') -> getcwd! .. ' spook% '
-- defining additional commands can be done like this:
cmdline\cmd "mycmd", "Does really nice stuff", (screen) ->
print os.time!
-- completely dynamic commands can also be done like this (executes given command in PATH):
:concat, :insert = table
cmdline\dynamic (c, key, value) ->
(screen, ...) ->
args = {key}
insert args, arg for arg in *{...}
os.execute concat(args, ' ')
-- actually using the repl requires a reader on stdin, like this
S = require 'syscall'
on_read S.stdin, repl
Help is by default available through the "help" command.
Implements a repl, accessed by pressing enter. There are a few basic commands accessible atm the idea being that most commands would be project specific. It's straightforward to add more commands. Sample from Spookfile:
Help is by default available through the "help" command.