backy/cmd/version.go
2023-02-18 22:52:10 -06:00

26 lines
313 B
Go

package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
const versionStr = "0.2.4"
var (
versionCmd = &cobra.Command{
Use: "version",
Short: "Prints the version and exits.",
Run: version,
}
)
func version(cmd *cobra.Command, args []string) {
fmt.Printf("%s\n", versionStr)
os.Exit(0)
}