Skip to content

Commit

Permalink
Added version command
Browse files Browse the repository at this point in the history
  • Loading branch information
distorhead committed Dec 25, 2018
1 parent e4af9cc commit ed7a014
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/kubedog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/flant/kubedog/pkg/kube"
"github.com/flant/kubedog/pkg/kubedog"
"github.com/flant/kubedog/pkg/tracker"
"github.com/flant/kubedog/pkg/trackers/follow"
"github.com/flant/kubedog/pkg/trackers/rollout"
Expand Down Expand Up @@ -62,6 +63,14 @@ func main() {
rootCmd.PersistentFlags().IntVarP(&timeoutSeconds, "timeout", "t", -1, "watch timeout in seconds") // default is 0 for follow
rootCmd.PersistentFlags().StringVarP(&logsSince, "logs-since", "", "now", "logs newer than a relative duration like 30s, 5m, or 2h")

versionCmd := &cobra.Command{
Use: "version",
Run: func(_ *cobra.Command, _ []string) {
fmt.Println(kubedog.Version)
},
}
rootCmd.AddCommand(versionCmd)

followCmd := &cobra.Command{Use: "follow"}
rootCmd.AddCommand(followCmd)

Expand Down
5 changes: 5 additions & 0 deletions pkg/kubedog/kubedog.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package kubedog

var (
Version = "dev"
)

0 comments on commit ed7a014

Please sign in to comment.