From 2c308f6cc69f6faf350e83ea6edcb531bdb0a09f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 6 Feb 2013 15:09:20 -0500 Subject: [PATCH] ui.cli: Add an `answer` command to QuestionCommandLine This allows you to bypass quizzer-shell command handling when your answer line starts with a quizzer-shell command. --- quizzer/ui/cli.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/quizzer/ui/cli.py b/quizzer/ui/cli.py index 1740e00..fbebf4f 100644 --- a/quizzer/ui/cli.py +++ b/quizzer/ui/cli.py @@ -78,6 +78,16 @@ class QuestionCommandLine (_cmd.Cmd): return True # out of questions self._reset() + def do_answer(self, arg): + """Explicitly add a line to your answer + + This is useful if the line you'd like to add starts with a + quizzer-shell command. For example: + + quizzer? answer help=5 + """ + return self.default(arg) + def do_quit(self, arg): "Stop taking the quiz" self._reset() -- 2.26.2