From a36a7a6809a83c15c4311b593462014c7866943d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 6 Feb 2013 09:47:26 -0500 Subject: [PATCH] cli: Add --all for easy review of previously-answered questions --- quizzer/cli.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/quizzer/cli.py b/quizzer/cli.py index d4454fb..cadc950 100644 --- a/quizzer/cli.py +++ b/quizzer/cli.py @@ -34,6 +34,10 @@ def main(): parser.add_argument( '-a', '--answers', metavar='ANSWERS', default='answers.json', help='path to an answers database') + parser.add_argument( + '--all', action='store_const', const=True, default=False, + help=('ask all questions ' + '(not just never-correctly-answered leaf questions)')) parser.add_argument( 'quiz', metavar='QUIZ', help='path to a quiz file') @@ -47,7 +51,10 @@ def main(): answers.load() except IOError: pass - ui = _cli.CommandLineInterface(quiz=quiz, answers=answers) + stack = None + if args.all: + stack = [question for question in quiz] + ui = _cli.CommandLineInterface(quiz=quiz, answers=answers, stack=stack) ui.run() ui.answers.save() ui.display_results() -- 2.26.2