2015-01-16 21:26:33 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
|
|
|
|
2016-09-17 12:36:05 +02:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
2015-01-16 21:26:33 +01:00
|
|
|
|
2016-09-17 12:36:05 +02:00
|
|
|
var versionCmd = &cobra.Command{
|
|
|
|
Use: "version",
|
2017-02-13 16:02:47 +01:00
|
|
|
Short: "print version information",
|
2016-09-17 12:36:05 +02:00
|
|
|
Long: `
|
|
|
|
The "version" command prints detailed information about the build environment
|
|
|
|
and the version of this software.
|
|
|
|
`,
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
2016-12-19 21:14:12 +01:00
|
|
|
fmt.Printf("restic %s\ncompiled with %v on %v/%v\n",
|
|
|
|
version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
2016-09-17 12:36:05 +02:00
|
|
|
},
|
2015-01-16 21:26:33 +01:00
|
|
|
}
|
|
|
|
|
2016-09-17 12:36:05 +02:00
|
|
|
func init() {
|
|
|
|
cmdRoot.AddCommand(versionCmd)
|
2015-01-16 21:26:33 +01:00
|
|
|
}
|