From: W. Trevor King Date: Wed, 6 Feb 2013 20:09:20 +0000 (-0500) Subject: ui.cli: Add an `answer` command to QuestionCommandLine X-Git-Tag: v0.1~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2c308f6cc69f6faf350e83ea6edcb531bdb0a09f;p=quizzer.git 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. --- 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()