1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-09-18 19:22:32 +01:00

#154 Add priority to rules

This commit is contained in:
nvbn
2015-05-06 13:57:09 +02:00
parent 5864faadef
commit fc3fcf028a
6 changed files with 56 additions and 26 deletions

View File

@@ -1,4 +1,5 @@
from thefuck import types
from thefuck.conf import DEFAULT_PRIORITY
def Command(script='', stdout='', stderr=''):
@@ -8,6 +9,8 @@ def Command(script='', stdout='', stderr=''):
def Rule(name='', match=lambda *_: True,
get_new_command=lambda *_: '',
enabled_by_default=True,
side_effect=None):
side_effect=None,
priority=DEFAULT_PRIORITY):
return types.Rule(name, match, get_new_command,
enabled_by_default, side_effect)
enabled_by_default, side_effect,
priority)