added (-h) self documentation to template-* functions