From a0e22acbd58b59e2013c19be40773dd6fe7c15fd Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 25 Jul 2013 16:40:48 +0800 Subject: [PATCH] Added autofix option to fix command --- extra/bash_completion | 2 +- lib/commands/fix.py | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/extra/bash_completion b/extra/bash_completion index e6448cf..0fed05a 100644 --- a/extra/bash_completion +++ b/extra/bash_completion @@ -123,7 +123,7 @@ function _mdk() { if [[ "$PREV" == "-n" || "$PREV" == "--name" ]]; then OPTS=`$BIN info -ln` else - OPTS="--name" + OPTS="--autofix --name" fi ;; info) diff --git a/lib/commands/fix.py b/lib/commands/fix.py index 97d41f2..d8a67be 100644 --- a/lib/commands/fix.py +++ b/lib/commands/fix.py @@ -45,6 +45,14 @@ class FixCommand(Command): } ), ( + ['--autofix'], + { + 'action': 'store_true', + 'default': '', + 'help': 'auto fix the bug related to the issue number' + } + ), + ( ['-n', '--name'], { 'default': None, @@ -80,3 +88,18 @@ class FixCommand(Command): raise Exception('Error while checkout out branch %s' % branch) logging.info('Branch %s checked out' % branch) + + # Auto-fixing the bug + if args.autofix: + logging.info('Auto fixing bug, please wait...') + from time import sleep + sleep(3) + logging.info('That\'s a tricky one! Bear with me.') + sleep(3) + logging.info('Almost there!') + sleep(3) + logging.info('...') + sleep(3) + logging.info('You didn\'t think I was serious, did you?') + sleep(3) + logging.info('Now get to work!') -- 2.11.0