Skip to content

Commit

Permalink
add version cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusfm committed Mar 5, 2023
1 parent c31e7cf commit ffa81e3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cmd

import "github.com/spf13/cobra"

var (
version = "dev"
commit = ""
date = ""
versionCmd = &cobra.Command{
Use: "version",
Short: "version",
Run: func(cmd *cobra.Command, args []string) {
t := newTable()
t.SetHeader([]string{"Version", "Date", "Commit"})
t.Append([]string{version, date, commit})
t.Render()
},
}
)

func init() {
rootCmd.AddCommand(versionCmd)
}

0 comments on commit ffa81e3

Please sign in to comment.