mirror of https://github.com/Hilbis/Hilbish
parent
06221e06cd
commit
e3a0195eb3
19
api.go
19
api.go
|
@ -14,7 +14,6 @@ import (
|
|||
|
||||
"hilbish/util"
|
||||
|
||||
"github.com/pborman/getopt"
|
||||
"github.com/yuin/gopher-lua"
|
||||
"mvdan.cc/sh/v3/interp"
|
||||
)
|
||||
|
@ -24,7 +23,6 @@ var exports = map[string]lua.LGFunction {
|
|||
"appendPath": hlappendPath,
|
||||
"cwd": hlcwd,
|
||||
"exec": hlexec,
|
||||
"flag": hlflag,
|
||||
"multiprompt": hlmlprompt,
|
||||
"prependPath": hlprependPath,
|
||||
"prompt": hlprompt,
|
||||
|
@ -101,23 +99,6 @@ func hlrun(L *lua.LState) int {
|
|||
return 1
|
||||
}
|
||||
|
||||
// flag(f)
|
||||
// Checks if the `f` flag has been passed to Hilbish.
|
||||
func hlflag(L *lua.LState) int {
|
||||
flagchar := L.CheckString(1)
|
||||
|
||||
flag := getopt.Lookup([]rune(flagchar)[0])
|
||||
if flag == nil {
|
||||
L.Push(lua.LNil)
|
||||
return 1
|
||||
}
|
||||
|
||||
passed := flag.Seen()
|
||||
L.Push(lua.LBool(passed))
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
// cwd()
|
||||
// Returns the current directory of the shell
|
||||
func hlcwd(L *lua.LState) int {
|
||||
|
|
Loading…
Reference in New Issue