I appreciate the explanation of how to possibly work around the initial problem, but my proposed solution is less work, less code, tested, just as flexible wrt to controlling the format, and results IMO in a friendlier and more robust interface.
Did you have some reason for not liking that direction?
It's just very limited and the point seems to be to be flexible about how the lines are formatted, right? What if I wanted to see the address, the block size, and the block number? With a format string, I could do this:
%(line_sz)2i * %(i)04i [%(addr)04x]
It just seems like if we're going to do it, we should use a formatted string. If we do the simple thing and then want the more complicated thing later, we have to worry about honoring the old configuration value if present, else the new, or deprecate the old one, etc. It's a trivial amount of work to make it totally flexible, so it seems worth doing. If you don't want to do it, I'll plan to cook up a patch tomorrow to make it flexible and run it by you to see if it works for you, okay?
--Dan