-
Notifications
You must be signed in to change notification settings - Fork 649
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #552 from ishan16696/versionFlag
Added bbolt command line version flag to get runtime information.
- Loading branch information
Showing
5 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"runtime" | ||
|
||
"github.com/spf13/cobra" | ||
"go.etcd.io/bbolt/version" | ||
) | ||
|
||
func newVersionCobraCommand() *cobra.Command { | ||
versionCmd := &cobra.Command{ | ||
Use: "version", | ||
Short: "print the current version of bbolt", | ||
Long: "print the current version of bbolt", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Printf("bbolt Version: %s\n", version.Version) | ||
fmt.Printf("Go Version: %s\n", runtime.Version()) | ||
fmt.Printf("Go OS/Arch: %s/%s\n", runtime.GOOS, runtime.GOARCH) | ||
}, | ||
} | ||
|
||
return versionCmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package version | ||
|
||
var ( | ||
// Version shows the last bbolt binary version released. | ||
Version = "1.3.7" | ||
) |