| Conditions | 2 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import re |
||
| 4 | def command_with_replaced_help(*replacements): |
||
| 5 | |||
| 6 | class CommandWithReplacedHelp(click.Command): |
||
| 7 | def get_help(self, ctx): |
||
| 8 | help = super().get_help(ctx) |
||
| 9 | for replacement in replacements: |
||
| 10 | help = re.sub(*replacement, help) |
||
| 11 | # print(help) |
||
| 12 | return help |
||
| 13 | |||
| 14 | return CommandWithReplacedHelp |
||
| 15 | |||
| 40 |