Add --bytes/-b
flag to display byte counts instead of human-readable values
#12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses #6, though very inelegantly.
--bytes
that displays byte values instead of human-readable values for all output. (I put Google Translate-based guesses in for French and German translations, as I don't speak those languages.)display_item
function to work with any reference toT
implementingDisplay
; also adds adisplay_bytes
flag. Updates all code locations where file or directory sizes are printed so that this function is used. (This introduces a check thatsize != FileSize::new(0)
in all print statements, which does not match prior behavior e.g. at https://github.com/vmchale/tin-summer/pull/12/files#diff-9801ad6b6d07be3a4b68f9fd9e3b9832R273 or at https://github.com/vmchale/tin-summer/pull/12/files#diff-5899cfb17ab780a6ee6255135e9f06feR680. This would be easy to rectify if there is a concern.)read_all
,read_all_fast
,display_tree
fns, and theWalk
struct, to add parameters or fields capturing whether or not data should be displayed as bytes.Some things still need to be addressed:
-b
.Please let me know what I can change in this PR to make it usable - this is my first time attempting to contribute to this project.