mirror of https://github.com/Hilbis/Hilbish
feat: add hilbish.exitCode property (closes #101)
parent
928b829388
commit
4b57dc2ed8
1
api.go
1
api.go
|
@ -65,6 +65,7 @@ The nice lil shell for {blue}Lua{reset} fanatics!
|
||||||
util.SetField(L, mod, "login", lua.LBool(interactive), "Whether this is a login shell")
|
util.SetField(L, mod, "login", lua.LBool(interactive), "Whether this is a login shell")
|
||||||
util.SetField(L, mod, "greeting", lua.LString(greeting), "Hilbish's welcome message for interactive shells. It has Lunacolors formatting.")
|
util.SetField(L, mod, "greeting", lua.LString(greeting), "Hilbish's welcome message for interactive shells. It has Lunacolors formatting.")
|
||||||
util.SetField(l, mod, "vimMode", lua.LNil, "Current Vim mode of Hilbish (nil if not in Vim mode)")
|
util.SetField(l, mod, "vimMode", lua.LNil, "Current Vim mode of Hilbish (nil if not in Vim mode)")
|
||||||
|
util.SetField(l, hshMod, "exitCode", lua.LNumber(0), "Exit code of last exected command")
|
||||||
util.Document(L, mod, "Hilbish's core API, containing submodules and functions which relate to the shell itself.")
|
util.Document(L, mod, "Hilbish's core API, containing submodules and functions which relate to the shell itself.")
|
||||||
|
|
||||||
// hilbish.userDir table
|
// hilbish.userDir table
|
||||||
|
|
1
exec.go
1
exec.go
|
@ -244,5 +244,6 @@ func cmdFinish(code uint8, cmdstr, oldInput string) {
|
||||||
if !strings.HasPrefix(oldInput, " ") || interactive {
|
if !strings.HasPrefix(oldInput, " ") || interactive {
|
||||||
handleHistory(cmdstr)
|
handleHistory(cmdstr)
|
||||||
}
|
}
|
||||||
|
util.SetField(l, hshMod, "exitCode", lua.LNumber(code), "Exit code of last exected command")
|
||||||
hooks.Em.Emit("command.exit", code, cmdstr)
|
hooks.Em.Emit("command.exit", code, cmdstr)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue