lispect.exe now uses gmnlisp/exit packages and enables to use (quit N) with no stacktraces

This commit is contained in:
HAYAMA Kaoru
2025-08-17 22:04:00 +09:00
parent 4be3d65850
commit 981deeee77
+6
View File
@@ -1,10 +1,12 @@
package main
import (
"errors"
"fmt"
"os"
"runtime"
"github.com/hymkor/gmnlisp/exit"
"github.com/hymkor/lispect"
)
@@ -22,6 +24,10 @@ func mains(args []string) error {
}
func main() {
if err := mains(os.Args[1:]); err != nil {
var exitError exit.ExitError
if errors.As(err, &exitError) {
os.Exit(exitError.Value)
}
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}