diff --git a/main.go b/main.go index 06cba663..8148056b 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ package main import ( "flag" "fmt" + "runtime" "runtime/pprof" _ "github.com/go-python/gpython/builtin" @@ -63,6 +64,12 @@ func main() { args := flag.Args() py.MustGetModule("sys").Globals["argv"] = pysys.MakeArgv(args) if len(args) == 0 { + + fmt.Printf("Python 3.4.0 (%s, %s)\n", commit, date) + fmt.Printf("[Gpython %s]\n", version) + fmt.Printf("- os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH) + fmt.Printf("- go version: %s\n", runtime.Version()) + cli.RunREPL() return } diff --git a/repl/cli/cli.go b/repl/cli/cli.go index 1affc2c5..f7618ea9 100644 --- a/repl/cli/cli.go +++ b/repl/cli/cli.go @@ -129,8 +129,6 @@ func RunREPL() { fmt.Printf("Failed to open history: %v\n", err) } - fmt.Printf("Gpython 3.4.0\n") - for { line, err := rl.Prompt(rl.prompt) if err != nil { diff --git a/version.go b/version.go new file mode 100644 index 00000000..857ae35d --- /dev/null +++ b/version.go @@ -0,0 +1,11 @@ +// Copyright 2018 The go-python Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +var ( + version = "dev" + commit = "none" + date = "unknown" +) \ No newline at end of file