diff --git a/src/interactive.py b/src/interactive.py index 7f5973c..d51e528 100644 --- a/src/interactive.py +++ b/src/interactive.py @@ -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: