Updated README.md
This commit is contained in:
@@ -14,7 +14,7 @@ import re
|
|||||||
|
|
||||||
from click.testing import CliRunner
|
from click.testing import CliRunner
|
||||||
|
|
||||||
from osxphotos.cli import help
|
from osxphotos.cli import cli_main
|
||||||
from osxphotos.phototemplate import (
|
from osxphotos.phototemplate import (
|
||||||
FILTER_VALUES,
|
FILTER_VALUES,
|
||||||
TEMPLATE_SUBSTITUTIONS,
|
TEMPLATE_SUBSTITUTIONS,
|
||||||
@@ -73,11 +73,11 @@ def generate_help_text(command):
|
|||||||
|
|
||||||
# get current help text
|
# get current help text
|
||||||
with runner.isolated_filesystem():
|
with runner.isolated_filesystem():
|
||||||
result = runner.invoke(help, [command])
|
result = runner.invoke(cli_main, ["help", command])
|
||||||
help_txt = result.output
|
help_txt = result.output
|
||||||
|
|
||||||
# running the help command above doesn't output the full "Usage" line
|
# running the help command above doesn't output the full "Usage" line
|
||||||
help_txt = help_txt.replace(f"Usage: {command}", f"Usage: osxphotos {command}")
|
help_txt = help_txt.replace(f"Usage: cli-main", f"Usage: osxphotos")
|
||||||
return help_txt
|
return help_txt
|
||||||
|
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ def replace_text(text, start_tag, stop_tag, replacement_text, prefix="", postfix
|
|||||||
end = text.split(stop_tag)[1]
|
end = text.split(stop_tag)[1]
|
||||||
except IndexError as e:
|
except IndexError as e:
|
||||||
# didn't find one of the delimiters
|
# didn't find one of the delimiters
|
||||||
raise ValueError(f"Unable to parse input: {e}")
|
raise ValueError(f"Unable to parse input: {e}") from e
|
||||||
|
|
||||||
return begin + start_tag + prefix + replacement_text + postfix + stop_tag + end
|
return begin + start_tag + prefix + replacement_text + postfix + stop_tag + end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user