Skip to content

Commit

Permalink
Add version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
John Bryan Sazon committed May 2, 2018
1 parent d1367e5 commit 9d58571
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ var srcFile, destDir string
var rootCmd = &cobra.Command{
Use: "gota",
Short: "Go Over the Air installation for Android APK and iOS Ipa files!",
Run: func(cmd *cobra.Command, args []string) {
cmd.SetVersionTemplate("v0.1.4")
},
Version: getVersion(),
}

// Execute adds all child commands to the root command and sets flags appropriately.
Expand Down
12 changes: 12 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package cmd

import (
"fmt"
"runtime"
)

const version = "v0.1.4"

func getVersion() string {
return fmt.Sprintf("%s %s/%s", version, runtime.GOOS, runtime.GOARCH)
}

0 comments on commit 9d58571

Please sign in to comment.