def show_removed(self, cli, markdown_dir): commands = HelpParser().parse_help_overview( CliCaller(cli).help()).flat() removed_commands = [] for markdown_file in os.listdir(markdown_dir): command = os.path.splitext(markdown_file)[0] if not command in commands: removed_commands.append(command) for command in sorted(removed_commands): print(command)
class Generator: def __init__(self, cli, renderer): self.cli = CliCaller(cli) self.renderer = renderer def generate_command(self, command): print("Command %s" % command) command_output = self.cli.help(command) help_data = HelpParser().parse_help_command(command_output) self.renderer.render_cmd_page(command, help_data) def generate_overview(self): help_output = self.cli.help() command_list = HelpParser().parse_help_overview(help_output) self.renderer.render_overview_page(command_list.grouped()) count = 1 for command in command_list.flat(): self.generate_command(command) count += 1 print("Generated pages for %s commands." % count)
def get_help(self, cli, command): print(CliCaller(cli).help(command))
def __init__(self, cli, renderer): self.cli = CliCaller(cli) self.renderer = renderer
def update_references(self, cli, docs_dir): commands = HelpParser().parse_help_overview( CliCaller(cli).help()).flat() references = References(docs_dir) references.update(commands)
def show_missing(self, cli, annotations_file): commands = HelpParser().parse_help_overview( CliCaller(cli).help()).flat() annotations = Annotations(annotations_file) annotations.show_missing(commands)