mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
cmd/version: print os/version, kernel and bitness (#5204)
Related to #5121 Note: OpenBSD is stub yet. This will be fixed after upstream PR gets resolved https://github.com/shirou/gopsutil/pull/993
This commit is contained in:
11
cmd/cmd.go
11
cmd/cmd.go
@@ -75,8 +75,19 @@ const (
|
||||
|
||||
// ShowVersion prints the version to stdout
|
||||
func ShowVersion() {
|
||||
osVersion, osKernel := buildinfo.GetOSVersion()
|
||||
if osVersion == "" {
|
||||
osVersion = "unknown"
|
||||
}
|
||||
if osKernel == "" {
|
||||
osKernel = "unknown"
|
||||
}
|
||||
|
||||
linking, tagString := buildinfo.GetLinkingAndTags()
|
||||
|
||||
fmt.Printf("rclone %s\n", fs.Version)
|
||||
fmt.Printf("- os/version: %s\n", osVersion)
|
||||
fmt.Printf("- os/kernel: %s\n", osKernel)
|
||||
fmt.Printf("- os/type: %s\n", runtime.GOOS)
|
||||
fmt.Printf("- os/arch: %s\n", runtime.GOARCH)
|
||||
fmt.Printf("- go/version: %s\n", runtime.Version())
|
||||
|
||||
Reference in New Issue
Block a user