restic/cmd/restic/cmd_version.go

26 lines
432 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 {
2015-06-24 17:59:31 +02:00
fmt.Printf("restic %s\ncompiled at %s with %v\n",
version, compiledAt, runtime.Version())
2015-01-16 21:26:33 +01:00
return nil
}