mirror of
https://github.com/hymkor/lispect.git
synced 2026-08-28 04:46:59 -04:00
With no arguments, print version and architecture information
This commit is contained in:
@@ -2,13 +2,15 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/hymkor/gmnlisp"
|
||||
)
|
||||
|
||||
var version string
|
||||
|
||||
func mains(args []string) error {
|
||||
term, err := NewTerm()
|
||||
if err != nil {
|
||||
@@ -37,7 +39,11 @@ func mains(args []string) error {
|
||||
})
|
||||
|
||||
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])
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user