コード例 #1
0
 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)
コード例 #2
0
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)
コード例 #3
0
 def get_help(self, cli, command):
     print(CliCaller(cli).help(command))
コード例 #4
0
 def __init__(self, cli, renderer):
     self.cli = CliCaller(cli)
     self.renderer = renderer
コード例 #5
0
 def update_references(self, cli, docs_dir):
     commands = HelpParser().parse_help_overview(
         CliCaller(cli).help()).flat()
     references = References(docs_dir)
     references.update(commands)
コード例 #6
0
 def show_missing(self, cli, annotations_file):
     commands = HelpParser().parse_help_overview(
         CliCaller(cli).help()).flat()
     annotations = Annotations(annotations_file)
     annotations.show_missing(commands)