mirror of
https://github.com/octoleo/restic.git
synced 2024-12-04 19:03:46 +00:00
27 lines
529 B
Go
27 lines
529 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "print version information",
|
|
Long: `
|
|
The "version" command prints detailed information about the build environment
|
|
and the version of this software.
|
|
`,
|
|
DisableAutoGenTag: true,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Printf("restic %s\ncompiled with %v on %v/%v\n",
|
|
version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
cmdRoot.AddCommand(versionCmd)
|
|
}
|