Print prettier version info
This commit is contained in:
parent
9b40934654
commit
5d896ae439
4 changed files with 32 additions and 11 deletions
|
@ -13,16 +13,11 @@ import (
|
|||
"github.com/khlieng/dispatch/storage"
|
||||
"github.com/khlieng/dispatch/storage/bleve"
|
||||
"github.com/khlieng/dispatch/storage/boltdb"
|
||||
"github.com/khlieng/dispatch/version"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
var (
|
||||
version = "dev"
|
||||
commit = "none"
|
||||
date = "unknown"
|
||||
)
|
||||
|
||||
const logo = `
|
||||
____ _ _ _
|
||||
| _ \ (_) ___ _ __ __ _ | |_ ___ | |__
|
||||
|
@ -42,7 +37,7 @@ var rootCmd = &cobra.Command{
|
|||
Short: "Web-based IRC client in Go.",
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
if cmd.Use == "dispatch" {
|
||||
fmt.Printf(logo, version, commit, date)
|
||||
fmt.Printf(logo, version.Tag, version.Commit, version.Date)
|
||||
}
|
||||
|
||||
storage.Initialize(viper.GetString("dir"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue