Total Complexity | 6 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
11 | class CcCommandLineOptions(rst.Directive): |
||
12 | def _format_option(self, option): |
||
13 | return [ |
||
14 | ".. _`%s`:" % option.name, |
||
15 | "", |
||
16 | ".. option:: " + ", ".join(option.opts), |
||
17 | "", |
||
18 | option.help, |
||
19 | "" |
||
20 | ] |
||
21 | |||
22 | def process_actions(self): |
||
23 | for option in cli.main.params: |
||
24 | if isinstance(option, click.core.Option): |
||
25 | for line in self._format_option(option): |
||
26 | self.view_list.append(line, "") |
||
27 | |||
28 | def run(self): |
||
29 | node = nodes.paragraph() |
||
30 | node.document = self.state.document |
||
31 | self.view_list = ViewList() |
||
32 | self.process_actions() |
||
33 | self.state.nested_parse(self.view_list, 0, node) |
||
34 | return [node] |
||
35 | |||
39 |