Version returns `version` command
(c *Cmd)
| 8 | |
| 9 | // Version returns `version` command |
| 10 | func Version(c *Cmd) *cobra.Command { |
| 11 | return &cobra.Command{ |
| 12 | Use: "version", |
| 13 | Short: "Print version information", |
| 14 | Long: "Print the version, commit hash, and build date.", |
| 15 | Example: "git-profile version", |
| 16 | Run: func(cmd *cobra.Command, _ []string) { |
| 17 | ui.Println(cmd, ui.InfoStyle, "Git Profile") |
| 18 | ui.Println(cmd, ui.DefaultStyle, "Version: %s", c.Version) |
| 19 | ui.Println(cmd, ui.DefaultStyle, "Commit hash: %s", c.CommitHash) |
| 20 | ui.Println(cmd, ui.DefaultStyle, "Compiled on %s", c.CompileDate) |
| 21 | }, |
| 22 | } |
| 23 | } |