Adapted gen.pl with 'listcats' This commit is a part of "--help me if you can" Closes #5680
Reported-by: Dan Jacobson Fixes #4766 Closes #4916