Extract help function for cli