feat(cli): Support displaying storage values in base-2 [#2492] (#2502)

* Update display on repository summary

* Apply throughout app

* Situate units_test

* Update Command Line documentation

* Envar cleanup

* Rename to BytesString

* Restore envar string available for test

* Remove extraneous empty check and restore UIPreferences field for frontend

* PR: config bool cleanup and missed `BaseEnv`s

* Fix lint and test
This commit is contained in:
atom authored and GitHub committed 2022-10-24 19:00:36 -07:00
1 parent 7d47658cbb
commit c5efed01f4
40 files changed
+198 -149

No files matched your search

+5 -5
View File
@@ -329,7 +329,7 @@ func printRestoreStats(ctx context.Context, st restore.Stats) {
var maybeSkipped, maybeErrors string
if st.SkippedCount > 0 {
maybeSkipped = fmt.Sprintf(", skipped %v (%v)", st.SkippedCount, units.BytesStringBase10(st.SkippedTotalFileSize))
maybeSkipped = fmt.Sprintf(", skipped %v (%v)", st.SkippedCount, units.BytesString(st.SkippedTotalFileSize))
}
if st.IgnoredErrorCount > 0 {
@@ -340,7 +340,7 @@ func printRestoreStats(ctx context.Context, st restore.Stats) {
st.RestoredFileCount,
st.RestoredDirCount,
st.RestoredSymlinkCount,
units.BytesStringBase10(st.RestoredTotalFileSize),
units.BytesString(st.RestoredTotalFileSize),
maybeSkipped, maybeErrors)
}
@@ -421,7 +421,7 @@ func (c *commandRestore) run(ctx context.Context, rep repo.Repository) error {
}
if stats.SkippedCount > 0 {
maybeSkipped = fmt.Sprintf(", skipped %v (%v)", stats.SkippedCount, units.BytesStringBase10(stats.SkippedTotalFileSize))
maybeSkipped = fmt.Sprintf(", skipped %v (%v)", stats.SkippedCount, units.BytesString(stats.SkippedTotalFileSize))
}
if stats.IgnoredErrorCount > 0 {
@@ -429,8 +429,8 @@ func (c *commandRestore) run(ctx context.Context, rep repo.Repository) error {
}
log(ctx).Infof("Processed %v (%v) of %v (%v)%v%v%v.",
restoredCount, units.BytesStringBase10(stats.RestoredTotalFileSize),
enqueuedCount, units.BytesStringBase10(stats.EnqueuedTotalFileSize),
restoredCount, units.BytesString(stats.RestoredTotalFileSize),
enqueuedCount, units.BytesString(stats.EnqueuedTotalFileSize),
maybeSkipped,
maybeErrors,
maybeRemaining)