Skip to content

Commit

Permalink
Add version command
Browse files Browse the repository at this point in the history
  • Loading branch information
vqhuy authored and arlolra committed Dec 2, 2016
1 parent e13a234 commit bc2c84b
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bots/coniksbot/internal/cmd/version.go
Original file line number Diff line number Diff line change
@@ -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)
}
22 changes: 22 additions & 0 deletions client/coniksclient/internal/cmd/version.go
Original file line number Diff line number Diff line change
@@ -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)
}
4 changes: 4 additions & 0 deletions internal/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package internal

// Version of executables.
var Version = "0.0.0+git"
22 changes: 22 additions & 0 deletions keyserver/coniksserver/internal/cmd/version.go
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit bc2c84b

Please sign in to comment.