diff options
Diffstat (limited to 'cmd/ship/version.go')
| -rw-r--r-- | cmd/ship/version.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cmd/ship/version.go b/cmd/ship/version.go new file mode 100644 index 0000000..6e4314a --- /dev/null +++ b/cmd/ship/version.go | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | package main | ||
| 2 | |||
| 3 | import ( | ||
| 4 | "fmt" | ||
| 5 | |||
| 6 | "github.com/spf13/cobra" | ||
| 7 | ) | ||
| 8 | |||
| 9 | var versionCmd = &cobra.Command{ | ||
| 10 | Use: "version", | ||
| 11 | Short: "Show version information", | ||
| 12 | Run: func(cmd *cobra.Command, args []string) { | ||
| 13 | fmt.Printf("ship version %s\n", version) | ||
| 14 | fmt.Printf(" commit: %s\n", commit) | ||
| 15 | fmt.Printf(" built: %s\n", date) | ||
| 16 | }, | ||
| 17 | } | ||
