Add a don't repeat yourself rule

This commit is contained in:
mcarton
2015-05-08 01:46:00 +02:00
parent 29e70e14a0
commit 932a7c5db5
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
def match(command, settings):
split_command = command.script.split()
return len(split_command) >= 2 and split_command[0] == split_command[1]
def get_new_command(command, settings):
return command.script[command.script.find(' '):]
# it should be rare enough to actually have to type twice the same word, so
# this rule can have a higher priority to come before things like "cd cd foo"
priority = 900