modernized some parts of code and new flags system

This commit is contained in:
2025-11-01 22:56:31 -03:00
parent c44abc78d6
commit a0704d6ac6
2 changed files with 53 additions and 4 deletions

View File

@@ -147,4 +147,28 @@ func LChmod(L *lua.LState) int {
return 2
}
type Flag struct {
Name string
Path string
FlagType string
}
type Flags struct {
Flags []Flag
}
func (f Flags) LSetFlag(L *lua.LState) int {
flagtype := L.CheckString(1)
name := L.CheckString(2)
flagPath := L.CheckString(3)
f.Flags = append(f.Flags, Flag{
Name: name,
Path: flagPath,
FlagType: flagtype,
})
return 0
}
func llogger() *log.Logger { return log.New(os.Stderr, "script error: ", 0) }