Parse and sum size expressions like 1G or 200M
Summary:
ZFS commands like zfs list -t snapshot display sizes easy to read
by humans like 0B, 5K, 1G, 200M or 3T.
To answer questions like "What's the total size of all the snapshots
for that dataset?", this means to be able to compute basic additions
using terms with units.
This utility can do this:
zfs list -t snapshot | grep name | awk '{print $2}' | space-sum
Test Plan:
- cargo build
- space-sum -h
- zfs list ... > zfs-sizes.txt ; space-sum zfs-sizes.txt
- zfs list ... | space-sum
Reviewers: dereckson
Reviewed By: dereckson
Differential Revision: https://devcentral.nasqueron.org/D3254