Consider using the 'click' CLI toolkit: https://github.com/pallets/click click-man can then be used to output manpages (#9 ): https://github.com/click-contrib/click-man