From 2a79a5e413b41bbbe3886828a97958ca824e7bdc Mon Sep 17 00:00:00 2001 From: SpyCheese Date: Sun, 19 Apr 2015 09:03:34 +0500 Subject: [PATCH] Create rm_root.py --- thefuck/rules/rm_root.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 thefuck/rules/rm_root.py diff --git a/thefuck/rules/rm_root.py b/thefuck/rules/rm_root.py new file mode 100644 index 00000000..95d9fbdd --- /dev/null +++ b/thefuck/rules/rm_root.py @@ -0,0 +1,8 @@ +def match(command, settings): + return ('rm' in command.script + and '--help' not in command.script + and '--no-preserve-root' in command.stderr) + + +def get_new_command(command, settings): + return '{} --no-preserve-root'.format(command.script)