restic/src/cmds/restic/cmd_version.go

26 lines
471 B
Go
Raw Normal View History

2015-01-16 21:26:33 +01: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 15:46:50 +02: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 21:26:33 +01:00
return nil
}