mirror of
https://github.com/hymkor/lispect.git
synced 2026-09-02 15:17:49 -04:00
With no arguments, print version and architecture information
This commit is contained in:
@@ -2,13 +2,15 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/hymkor/gmnlisp"
|
"github.com/hymkor/gmnlisp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var version string
|
||||||
|
|
||||||
func mains(args []string) error {
|
func mains(args []string) error {
|
||||||
term, err := NewTerm()
|
term, err := NewTerm()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -37,7 +39,11 @@ func mains(args []string) error {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if len(args) <= 0 {
|
if len(args) <= 0 {
|
||||||
return errors.New("script path required")
|
return fmt.Errorf("%s %s-%s-%s: script path required",
|
||||||
|
os.Args[0],
|
||||||
|
version,
|
||||||
|
runtime.GOOS,
|
||||||
|
runtime.GOARCH)
|
||||||
}
|
}
|
||||||
script, err := os.ReadFile(args[0])
|
script, err := os.ReadFile(args[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user