shiori/internal/cmd/version.go
2023-07-21 09:25:19 +02:00

23 lines
515 B
Go

package cmd
import (
"github.com/go-shiori/shiori/internal/model"
"github.com/spf13/cobra"
)
func newVersionCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "version",
Short: "Output the shiori version",
Run: newVersionCommandHandler(),
}
return cmd
}
func newVersionCommandHandler() func(cmd *cobra.Command, args []string) {
return func(cmd *cobra.Command, args []string) {
cmd.Printf("Shiori version %s (build %s) at %s\n", model.BuildVersion, model.BuildCommit, model.BuildDate)
}
}