From 8d973932578c82c2ac3ef1fa7860cfb5065c0f8b Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Mon, 4 May 2020 23:09:14 +0200 Subject: [PATCH] Implement running as default --- markdownrunner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/markdownrunner.py b/markdownrunner.py index 9a0d835..64f7c47 100755 --- a/markdownrunner.py +++ b/markdownrunner.py @@ -122,7 +122,10 @@ def user_action(hunk: Sequence[Command], context=None) -> Sequence[Command]: print(stringify_hunk(hunk)) # TODO: Print prompt in color (green?) - answer = input("What to do: edit(e), run(y), skip(n)?") + answer = input("What to do: edit(e), run(y, default), skip(n)?") + if answer is None: + # Default is run, for convenience + answer = 'Y' if answer.startswith(('e', 'E')): import tempfile with tempfile.NamedTemporaryFile(mode='r+') as tmpfile: