Avoid the compression.
And add a "convert-cache" program to convert from old-style to new-style.
Do the usage and error reporting in "usage.c", and the sha1 file accesses in "sha1_file.c". Small, nice, easily separated parts. Good.