mirror of https://github.com/Hilbis/Hilbish
chore: reorder code
parent
e67c549714
commit
538ba3547f
|
@ -20,15 +20,19 @@ func New() Bait {
|
||||||
|
|
||||||
func (b *Bait) Loader(L *lua.LState) int {
|
func (b *Bait) Loader(L *lua.LState) int {
|
||||||
mod := L.SetFuncs(L.NewTable(), map[string]lua.LGFunction{})
|
mod := L.SetFuncs(L.NewTable(), map[string]lua.LGFunction{})
|
||||||
|
|
||||||
|
util.Document(L, mod,
|
||||||
|
`Bait is the event emitter for Hilbish. Why name it bait?
|
||||||
|
Because it throws hooks that you can catch (emits events
|
||||||
|
that you can listen to) and because why not, fun naming
|
||||||
|
is fun. This is what you will use if you want to listen
|
||||||
|
in on hooks to know when certain things have happened,
|
||||||
|
like when you've changed directory, a command has
|
||||||
|
failed, etc. To find all available hooks, see doc hooks.`)
|
||||||
|
|
||||||
L.SetField(mod, "throw", luar.New(L, b.bthrow))
|
L.SetField(mod, "throw", luar.New(L, b.bthrow))
|
||||||
L.SetField(mod, "catch", luar.New(L, b.bcatch))
|
L.SetField(mod, "catch", luar.New(L, b.bcatch))
|
||||||
|
|
||||||
util.Document(L, mod, `Bait is the event emitter for Hilbish. Why name it bait?
|
|
||||||
Because it throws hooks that you can catch
|
|
||||||
(emits events that you can listen to) and because why not,
|
|
||||||
fun naming is fun. This is what you will use if you want to
|
|
||||||
listen in on hooks to know when certain things have happened,
|
|
||||||
like when you've changed directory, a command has failed, etc.`)
|
|
||||||
L.Push(mod)
|
L.Push(mod)
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Reference in New Issue