Support long flag --delete

This commit is contained in:
Albert Portnoy 2023-01-03 20:17:54 -06:00 committed by GitHub
parent ceeaeab94b
commit a1f7a27b29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,10 +4,10 @@ from thefuck.specific.git import git_support
@git_support
def match(command):
return ('branch -d' in command.script
return (('branch -d' in command.script or 'branch --delete' in command.script)
and 'If you are sure you want to delete it' in command.output)
@git_support
def get_new_command(command):
return replace_argument(command.script, '-d', '-D')
return replace_argument(replace_argument(command.script, '-d', '-D'), '--delete', '-D')