MCPcopy Index your code
hub / github.com/Breakthrough/PySceneDetect / transform_add_option_refs

Function transform_add_option_refs

docs/generate_cli_docs.py:143–153  ·  view source on GitHub ↗
(s: str, refs: list[str])

Source from the content-addressed store, hash-verified

141
142
143def 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
156def format_option(command: click.Command, opt: click.Option, flags: list[str]) -> StrGenerator:

Callers 2

format_optionFunction · 0.85
generate_command_helpFunction · 0.85

Calls 1

add_backquotes_with_refsFunction · 0.85

Tested by

no test coverage detected