Skip to content

Commit

Permalink
cmd: remove seb-dump
Browse files Browse the repository at this point in the history
  • Loading branch information
micvbang committed Jul 5, 2024
1 parent 0e72f3e commit 61ed7f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 85 deletions.
81 changes: 0 additions & 81 deletions cmd/seb-dump/main.go

This file was deleted.

9 changes: 5 additions & 4 deletions cmd/seb/app/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"path/filepath"
"time"

"github.com/micvbang/go-helpy"
"github.com/micvbang/go-helpy/sizey"
"github.com/micvbang/go-helpy/slicey"
"github.com/micvbang/simple-event-broker/internal/infrastructure/logger"
Expand All @@ -22,7 +23,7 @@ func init() {
fs := dumpCmd.Flags()

fs.StringVarP(&dumpFlags.path, "path", "p", "", "Path to a .record_batch file")
fs.BoolVarP(&dumpFlags.dumpRecords, "dump-records", "a", true, "Whether to also dump record data")
fs.BoolVarP(&dumpFlags.dumpRecords, "dump-records", "a", false, "Whether to also dump record data")
fs.IntVarP(&dumpFlags.dumpRecordBytes, "dump-record-bytes", "b", 64, "Number of bytes to dump for each record, 0 for all of them")
}

Expand Down Expand Up @@ -101,9 +102,9 @@ var dumpCmd = &cobra.Command{
if dumpFlags.dumpRecords {
fmt.Printf("Records:\n")
for i, record := range records {
dumpBytes := len(record)
if dumpFlags.dumpRecordBytes > 0 && dumpFlags.dumpRecordBytes < len(record) {
dumpBytes = dumpFlags.dumpRecordBytes
dumpBytes := helpy.Clamp(dumpFlags.dumpRecordBytes, 1, len(record))
if dumpFlags.dumpRecordBytes == 0 {
dumpBytes = len(record)
}

var tail string
Expand Down

0 comments on commit 61ed7f3

Please sign in to comment.