Skip to content

Commit 61059b4

Browse files
kislenko-artemcorona10
authored andcommitted
#44 Display build information (#52)
* #44 Display build information * #44 Display build information (makefile was deleted) * #44 copyright header was added * #44 move out print from cli.go * #44 import order in cli.go
1 parent b05c0bd commit 61059b4

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package main
99
import (
1010
"flag"
1111
"fmt"
12+
"runtime"
1213
"runtime/pprof"
1314

1415
_ "github.com/go-python/gpython/builtin"
@@ -63,6 +64,12 @@ func main() {
6364
args := flag.Args()
6465
py.MustGetModule("sys").Globals["argv"] = pysys.MakeArgv(args)
6566
if len(args) == 0 {
67+
68+
fmt.Printf("Python 3.4.0 (%s, %s)\n", commit, date)
69+
fmt.Printf("[Gpython %s]\n", version)
70+
fmt.Printf("- os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
71+
fmt.Printf("- go version: %s\n", runtime.Version())
72+
6673
cli.RunREPL()
6774
return
6875
}

repl/cli/cli.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ func RunREPL() {
129129
fmt.Printf("Failed to open history: %v\n", err)
130130
}
131131

132-
fmt.Printf("Gpython 3.4.0\n")
133-
134132
for {
135133
line, err := rl.Prompt(rl.prompt)
136134
if err != nil {

version.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2018 The go-python Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
var (
8+
version = "dev"
9+
commit = "none"
10+
date = "unknown"
11+
)

0 commit comments

Comments
 (0)