summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@beefcake.parabola.nu>2018-05-20 14:52:08 -0400
committerLuke Shumaker <lukeshu@beefcake.parabola.nu>2018-05-20 14:52:08 -0400
commit805cc4ef8bc37858b712ac575de6d61967a6dc6f (patch)
treef94382751021d15fa6cadfdb515931054344456a
parentebf320ee2b1553d0894aacc5b12c646050ba9762 (diff)
more statusline improvements
-rw-r--r--go/src/cow-dedupe/dedupe.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/go/src/cow-dedupe/dedupe.go b/go/src/cow-dedupe/dedupe.go
index af2063a..b0a1471 100644
--- a/go/src/cow-dedupe/dedupe.go
+++ b/go/src/cow-dedupe/dedupe.go
@@ -120,12 +120,12 @@ func getChecksums(sl statusline.StatusLine, slfmt string, basecmd []string, path
ret[checksum] = append(ret[checksum], filename)
cnt++
- sl.Put(fmt.Sprintf("Generating checksums (%v) for files... %d/%d", basecmd, cnt, len(paths)))
+ sl.Put(fmt.Sprintf(slfmt, cnt, len(paths)))
}
errhandle(cmd.Wait())
}
- sl.Put(fmt.Sprintf("Generating checksums (%v) for files... done; summed %d files", basecmd, cnt))
+ sl.Put(fmt.Sprintf(slfmt, "done", cnt))
return ret
}
@@ -203,7 +203,7 @@ func main() {
sl.End(true)
sl = myStatusLine()
- size2filenames := getChecksums(sl, "Getting sizes for files... %d/%d",
+ size2filenames := getChecksums(sl, "Getting sizes for files... %v/%v",
[]string{"stat", "--printf=%s %n\\n", "--"}, spanningFiles)
sl.End(true)
@@ -218,7 +218,7 @@ func main() {
status.sizeC = len(filenames)
// Now do strict hashing, instead of the incredibly
// sloppy (but fast) size-bucketing.
- status.verb = "sha256sum[%d/%d]"
+ status.verb = "sha256sum[%v/%v]"
checksum2filenames := getChecksums(sl, status.String(), []string{"sha256sum", "--"}, filenames)
status.summed += len(filenames)
status.verb = "pruneSingles"
@@ -255,8 +255,8 @@ func main() {
}
// And actually dedupe those
name := filepath.Base(srcFile)
- if len(name) > 25 {
- name = name[:25]
+ if len(name) > 21 {
+ name = name[:20]+"…"
}
status.verb = fmt.Sprintf("dedupe %q (and %d more)", name, len(dupFiles))
sl.Put(status.String())