diff --git a/bots/coniksbot/internal/cmd/version.go b/bots/coniksbot/internal/cmd/version.go new file mode 100644 index 0000000..68b5d2a --- /dev/null +++ b/bots/coniksbot/internal/cmd/version.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "fmt" + + "github.com/coniks-sys/coniks-go/internal" + "github.com/spf13/cobra" +) + +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Print the version number of coniksbot.", + Long: `Print the version number of coniksbot.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("All software has versions. This is coniksbot's:") + fmt.Println("coniksbot v" + internal.Version) + }, +} + +func init() { + RootCmd.AddCommand(versionCmd) +} diff --git a/client/coniksclient/internal/cmd/version.go b/client/coniksclient/internal/cmd/version.go new file mode 100644 index 0000000..8bc8ddf --- /dev/null +++ b/client/coniksclient/internal/cmd/version.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "fmt" + + "github.com/coniks-sys/coniks-go/internal" + "github.com/spf13/cobra" +) + +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Print the version number of coniksclient.", + Long: `Print the version number of coniksclient.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("All software has versions. This is coniksclient's:") + fmt.Println("coniksclient v" + internal.Version) + }, +} + +func init() { + RootCmd.AddCommand(versionCmd) +} diff --git a/internal/version.go b/internal/version.go new file mode 100644 index 0000000..8cd5a2a --- /dev/null +++ b/internal/version.go @@ -0,0 +1,4 @@ +package internal + +// Version of executables. +var Version = "0.0.0+git" diff --git a/keyserver/coniksserver/internal/cmd/version.go b/keyserver/coniksserver/internal/cmd/version.go new file mode 100644 index 0000000..dd9314d --- /dev/null +++ b/keyserver/coniksserver/internal/cmd/version.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "fmt" + + "github.com/coniks-sys/coniks-go/internal" + "github.com/spf13/cobra" +) + +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Print the version number of coniksserver.", + Long: `Print the version number of coniksserver.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("All software has versions. This is coniksserver's:") + fmt.Println("coniksserver v" + internal.Version) + }, +} + +func init() { + RootCmd.AddCommand(versionCmd) +}