coalsont / zfs-scripts

some useful scripts related to zfs
MIT License
3 stars 1 forks source link

snapspace should place snapshot name last #2

Closed eharris closed 2 months ago

eharris commented 3 months ago

In order to avoid columns not matching up due to differences in length of snapshot name, the snapshot name should be the last item in each line rather than the first.

coalsont commented 3 months ago

It did align the columns, as long as the snapshot names were less than 44 characters. Names at the end does make it simpler and avoid that limitation, though. See how you like 0d637e15ba46a2fe9a7c5725f5eea6575578ca3d.

eharris commented 3 months ago

My snapshot names were longer, so they didn't get aligned. It was interesting to see the written@ syntax. I hadn't known about that feature.

Looks good as far as the code, but the readme is now out of date. And it might be good to do the same for snapreport so it is consistent.

coalsont commented 3 months ago

snapreport was in need of a small refactor anyway. I have updated these in f0c3838.

written@ does seem a bit obscure, but it has been around for a long time (the list archive where I posted my first version of this is dead...). Perhaps it is obscure because it needs a bit of math to make it into something useful.