Skip to content

Conversation

@kdkasad
Copy link
Contributor

@kdkasad kdkasad commented Jun 29, 2025

Adds a -h/--human-readable option to kopia ls to print sizes in human-readable format.

Copilot AI review requested due to automatic review settings June 29, 2025 05:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for a -h/--human-readable flag to the kopia ls command so sizes can be displayed in a human-readable format.

  • Introduces a humanSizes field and --human-readable flag with short -h
  • Updates printDirectoryEntry to format sizes via maybeHumanReadableBytes
Comments suppressed due to low confidence (3)

cli/command_ls.go:18

  • [nitpick] Consider renaming the humanSizes field to humanReadable (or similar) to more clearly match the --human-readable flag and improve consistency.
	humanSizes   bool

cli/command_ls.go:118

  • Add unit tests for the --human-readable flag to ensure maybeHumanReadableBytes formats sizes correctly in both human-readable and raw modes.
			maybeHumanReadableBytes(c.humanSizes, e.Size()),

cli/command_ls.go:31

  • Verify that the shortcut -h does not conflict with the default help flag; if it does, consider using a different shortcut or omitting the short form.
	cmd.Flag("human-readable", "Show human-readable sizes").Short('h').BoolVar(&c.humanSizes)

@codecov
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.38%. Comparing base (cb455c6) to head (406f5f4).
Report is 595 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4696      +/-   ##
==========================================
+ Coverage   75.86%   76.38%   +0.52%     
==========================================
  Files         470      530      +60     
  Lines       37301    40372    +3071     
==========================================
+ Hits        28299    30840    +2541     
- Misses       7071     7494     +423     
- Partials     1931     2038     +107     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@julio-lopez julio-lopez merged commit f40fe88 into kopia:master Jul 2, 2025
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Human readable sizes for kopia ls

2 participants