From: W. Trevor King Date: Wed, 6 Feb 2013 14:47:26 +0000 (-0500) Subject: cli: Add --all for easy review of previously-answered questions X-Git-Tag: v0.1~31 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a36a7a6809a83c15c4311b593462014c7866943d;p=quizzer.git cli: Add --all for easy review of previously-answered questions --- 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()