From acb820798b20055ff6ba77aee2d03a4a474eb7cb Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 29 Oct 2013 13:36:56 +0800 Subject: [PATCH] Accept -f argument to remove --- lib/commands/remove.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/commands/remove.py b/lib/commands/remove.py index e288713..4b5687f 100644 --- a/lib/commands/remove.py +++ b/lib/commands/remove.py @@ -42,6 +42,14 @@ class RemoveCommand(Command): 'dest': 'do', 'help': 'do not ask for confirmation' } + ), + ( + ['-f'], + { + 'action': 'store_true', + 'dest': 'force', + 'help': 'force and do not ask for confirmation' + } ) ] _description = 'Completely remove an instance' @@ -53,7 +61,7 @@ class RemoveCommand(Command): except: raise Exception('This is not a Moodle instance') - if not args.do: + if not args.do and not args.force: confirm = raw_input('Are you sure? (Y/n) ') if confirm != 'Y': logging.info('Aborting...') -- 2.11.0