fix: поправил опечатки в help, добавил обрезку пробелов

This commit is contained in:
ElectronixTM
2025-03-16 04:28:25 +03:00
parent 761f6ca9ff
commit 5a76bc4ee2

View File

@ -30,16 +30,20 @@ def interactve_mode(rulebook: Rulebook):
elif user_input.startswith("e:"):
return
elif user_input.startswith(":"):
print(rulebook.transform(user_input[1:]))
print(
rulebook.transform(
user_input[1:].strip(" \t")
)
)
else:
print(rulebook.transform(user_input))
print(rulebook.transform(user_input.strip(" \t")))
def print_help():
print("you can type expressions right after prompt. However there is some "
'reserved chars: "h:" to print help, "v:" to run next expression in '
print("You can type expressions right after prompt. However there are some "
'reserved sequences: "h:" to print help, "v:" to run next expression in '
'verbose mode, "r:" to view rules, "e:" to exit, and ":" to imidiately '
'start prompt.Can be omited if your prompt doesn\'t start from'
'reserved sequence. Note that your input after "h:", "e:" and "r:" will '
'start prompt (can be omitted if your prompt doesn\'t start from '
'reserved sequence). Note that your input after "h:", "e:" and "r:" will '
'be ignored')
def _print_rules(rules: list[Rule]) -> None: