diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/btrfs-rec/inspect_lstrees.go | 7 | ||||
-rw-r--r-- | cmd/btrfs-rec/main.go | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/cmd/btrfs-rec/inspect_lstrees.go b/cmd/btrfs-rec/inspect_lstrees.go index e0dc4e1..7f59eaa 100644 --- a/cmd/btrfs-rec/inspect_lstrees.go +++ b/cmd/btrfs-rec/inspect_lstrees.go @@ -6,7 +6,6 @@ package main import ( "encoding/json" - "fmt" "os" "strconv" "text/tabwriter" @@ -58,11 +57,11 @@ func init() { numWidth := len(strconv.Itoa(slices.Max(treeErrCnt, totalItems))) table := tabwriter.NewWriter(os.Stdout, 0, 8, 2, ' ', 0) - fmt.Fprintf(table, " errors\t% *s\n", numWidth, strconv.Itoa(treeErrCnt)) + textui.Fprintf(table, " errors\t% *s\n", numWidth, strconv.Itoa(treeErrCnt)) for _, typ := range maps.SortedKeys(treeItemCnt) { - fmt.Fprintf(table, " %v items\t% *s\n", typ, numWidth, strconv.Itoa(treeItemCnt[typ])) + textui.Fprintf(table, " %v items\t% *s\n", typ, numWidth, strconv.Itoa(treeItemCnt[typ])) } - fmt.Fprintf(table, " total items\t% *s\n", numWidth, strconv.Itoa(totalItems)) + textui.Fprintf(table, " total items\t% *s\n", numWidth, strconv.Itoa(totalItems)) table.Flush() } visitedNodes := make(containers.Set[btrfsvol.LogicalAddr]) diff --git a/cmd/btrfs-rec/main.go b/cmd/btrfs-rec/main.go index c808237..a221cb7 100644 --- a/cmd/btrfs-rec/main.go +++ b/cmd/btrfs-rec/main.go @@ -7,7 +7,6 @@ package main import ( "context" "encoding/json" - "fmt" "os" "github.com/datawire/dlib/dgroup" @@ -20,6 +19,7 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsutil" + "git.lukeshu.com/btrfs-progs-ng/lib/textui" ) type logLevelFlag struct { @@ -162,7 +162,7 @@ func main() { } if err := argparser.ExecuteContext(context.Background()); err != nil { - fmt.Fprintf(os.Stderr, "%v: error: %v\n", argparser.CommandPath(), err) + textui.Fprintf(os.Stderr, "%v: error: %v\n", argparser.CommandPath(), err) os.Exit(1) } } |