diff --git a/cmd/bbolt/bbolt.exe b/cmd/bbolt/bbolt.exe new file mode 100644 index 000000000..27e881832 Binary files /dev/null and b/cmd/bbolt/bbolt.exe differ diff --git a/cmd/bbolt/command_version.go b/cmd/bbolt/command_version.go index 39d756bd9..192384e4f 100644 --- a/cmd/bbolt/command_version.go +++ b/cmd/bbolt/command_version.go @@ -15,9 +15,9 @@ func newVersionCommand() *cobra.Command { 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) + fmt.Fprintln(cmd.OutOrStdout(), "bbolt Version: ", version.Version) + fmt.Fprintln(cmd.OutOrStdout(), "Go Version: ", runtime.Version()) + fmt.Fprintln(cmd.OutOrStdout(), "Go OS/Arch: ", runtime.GOOS, "/", runtime.GOARCH) }, } diff --git a/cmd/bbolt/main_test.go b/cmd/bbolt/main_test.go index 727b38f55..ef2b6f78e 100644 --- a/cmd/bbolt/main_test.go +++ b/cmd/bbolt/main_test.go @@ -274,36 +274,6 @@ func TestStatsCommand_Run(t *testing.T) { } } -// Ensure the "buckets" command can print a list of buckets. -func TestBucketsCommand_Run(t *testing.T) { - db := btesting.MustCreateDB(t) - - if err := db.Update(func(tx *bolt.Tx) error { - for _, name := range []string{"foo", "bar", "baz"} { - _, err := tx.CreateBucket([]byte(name)) - if err != nil { - return err - } - } - return nil - }); err != nil { - t.Fatal(err) - } - db.Close() - - defer requireDBNoChange(t, dbData(t, db.Path()), db.Path()) - - expected := "bar\nbaz\nfoo\n" - - // Run the command. - m := NewMain() - if err := m.Run("buckets", db.Path()); err != nil { - t.Fatal(err) - } else if actual := m.Stdout.String(); actual != expected { - t.Fatalf("unexpected stdout:\n\n%s", actual) - } -} - // Ensure the "keys" command can print a list of keys for a bucket. func TestKeysCommand_Run(t *testing.T) { testCases := []struct {