def run(self): if not self.ui.arguments['command_name']: version = '.'.join(map(str, cr_cache.__version__)) help = """crcache %s -- a free test repository https://github.com/rbtcollins/cr_cache/ crcache commands -- list commands crcache quickstart -- starter documentation crcache help [command] -- help system """ % version else: cmd = self.ui.arguments['command_name'][0] parser = get_command_parser(cmd) help = parser.format_help() self.ui.output_rest(help) return 0
def test_trivial(self): cmd = InstrumentedCommand(model.UI()) parser = commands.get_command_parser(cmd) self.assertThat(parser, IsInstance(optparse.OptionParser))