Other than the bikeshed about starting from zero instead of one, and not being completely happy with the option name --duplicate (but not being inspired to suggest a better one), this series looks OK to me. It seems like it would be quite useful to query based on the number of duplicates, but that is a much more ambitious task, I think. d