mirror of
https://github.com/octoleo/syncthing.git
synced 2025-04-11 03:51:51 +00:00
Always print long version at startup
This commit is contained in:
parent
f76fe1ac7a
commit
264bcbc78c
@ -32,11 +32,15 @@ var (
|
|||||||
Version = "unknown-dev"
|
Version = "unknown-dev"
|
||||||
BuildStamp = "0"
|
BuildStamp = "0"
|
||||||
BuildDate time.Time
|
BuildDate time.Time
|
||||||
|
LongVersion string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
stamp, _ := strconv.Atoi(BuildStamp)
|
stamp, _ := strconv.Atoi(BuildStamp)
|
||||||
BuildDate = time.Unix(int64(stamp), 0)
|
BuildDate = time.Unix(int64(stamp), 0)
|
||||||
|
|
||||||
|
date := BuildDate.UTC().Format(time.RFC3339)
|
||||||
|
LongVersion = fmt.Sprintf("syncthing %s (%s %s-%s) %s", Version, runtime.Version(), runtime.GOOS, runtime.GOARCH, date)
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -89,8 +93,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if showVersion {
|
if showVersion {
|
||||||
date := BuildDate.UTC().Format(time.RFC3339)
|
fmt.Println(LongVersion)
|
||||||
fmt.Printf("syncthing %s (%s %s-%s) %s\n", Version, runtime.Version(), runtime.GOOS, runtime.GOARCH, date)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +121,7 @@ func main() {
|
|||||||
log.SetPrefix("[" + myID[0:5] + "] ")
|
log.SetPrefix("[" + myID[0:5] + "] ")
|
||||||
logger.SetPrefix("[" + myID[0:5] + "] ")
|
logger.SetPrefix("[" + myID[0:5] + "] ")
|
||||||
|
|
||||||
infoln("Version", Version)
|
infoln(LongVersion)
|
||||||
infoln("My ID:", myID)
|
infoln("My ID:", myID)
|
||||||
|
|
||||||
// Prepare to be able to save configuration
|
// Prepare to be able to save configuration
|
||||||
|
Loading…
x
Reference in New Issue
Block a user