2
2
mirror of https://github.com/octoleo/restic.git synced 2024-06-07 19:40:49 +00:00
restic/src/cmds/restic/cmd_version.go

26 lines
471 B
Go
Raw Normal View History

2015-01-16 20:26:33 +00:00
package main
import (
"fmt"
"runtime"
)
type CmdVersion struct{}
func init() {
_, err := parser.AddCommand("version",
"display version",
"The version command displays detailed information about the version",
&CmdVersion{})
if err != nil {
panic(err)
}
}
func (cmd CmdVersion) Execute(args []string) error {
2016-09-04 13:46:50 +00:00
fmt.Printf("restic %s\ncompiled at %s with %v on %v/%v\n",
version, compiledAt, runtime.Version(), runtime.GOOS, runtime.GOARCH)
2015-01-16 20:26:33 +00:00
return nil
}