1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-11-20 08:46:14 +00:00

#N/A: Add git_bisect_usage rule

This commit is contained in:
Pablo Santiago Blum de Aguiar
2016-09-27 19:42:01 -03:00
parent 9660ec7813
commit c9264aff10
3 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import re
from thefuck.utils import replace_command
from thefuck.specific.git import git_support
@git_support
def match(command):
return ('bisect' in command.script_parts and
'usage: git bisect' in command.stderr)
@git_support
def get_new_command(command):
broken = re.findall(r'git bisect ([^ $]*).*', command.script)[0]
usage = re.findall(r'usage: git bisect \[([^\]]+)\]', command.stderr)[0]
return replace_command(command, broken, usage.split('|'))