vmchale / tin-summer

Find build artifacts that are taking up disk space
BSD 3-Clause "New" or "Revised" License
339 stars 16 forks source link

De-humanize sizes #6

Open NobbZ opened 7 years ago

NobbZ commented 7 years ago

In general the feature set seems to be very usable, but to make it actually usable for me, I need to have exact bytesizes to get processed by another script.

So is there an option that actually always lists bytes?

nadesai commented 6 years ago

Seconding this, it would really help my use case.

nadesai commented 6 years ago

I was able to do this in a very ugly fashion by changing impl fmt::Display for FileSize to display bytes instead of human-readable output in all cases. Unless I'm missing something, there's no way to check state while respecting the Display trait, so this wouldn't work in general.

However, the impl for Debug already displays raw bytes as desired, so displaying bytes conditionally should be as simple as

I'm trying to do this on my own fork, though the resulting code is not very elegant right now.