(s: str, refs: list[str])
| 141 | |
| 142 | |
| 143 | def transform_add_option_refs(s: str, refs: list[str]) -> str: |
| 144 | transform = add_backquotes_with_refs(refs) |
| 145 | # TODO: Match prefix of `global option` and add ref to parent `scenedetect` command option. |
| 146 | # Replace patch to complete this. |
| 147 | # -c/--command |
| 148 | s = re.sub(r"-\w/--\w[\w-]*", transform, s) |
| 149 | # --arg=value, --arg=1.2.3, --arg=1,2,3 |
| 150 | s = re.sub(r'-+[\w-]+=[^"\s\)]+(?<![\.\,])', transform, s) |
| 151 | # --args=" command with spaces" |
| 152 | s = re.sub(r'--[\w-]+[=]+".*?"', transform, s) |
| 153 | return s |
| 154 | |
| 155 | |
| 156 | def format_option(command: click.Command, opt: click.Option, flags: list[str]) -> StrGenerator: |
no test coverage detected