zrepl/cmd/version.go

22 lines
423 B
Go
Raw Normal View History

package cmd
import (
"fmt"
"github.com/spf13/cobra"
2018-08-26 21:57:19 +02:00
"github.com/zrepl/zrepl/version"
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "print version of zrepl binary (for running daemon 'zrepl control version' command)",
Run: doVersion,
}
func init() {
RootCmd.AddCommand(versionCmd)
}
func doVersion(cmd *cobra.Command, args []string) {
2018-08-26 21:57:19 +02:00
fmt.Println(version.NewZreplVersionInformation().String())
}