1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-20 20:09:07 +00:00

Make thefuck-alias depends on current shell

This commit is contained in:
nvbn 2015-05-03 13:04:33 +02:00
parent bcd3154121
commit 3ce8c1187c
2 changed files with 8 additions and 1 deletions

View File

@ -120,7 +120,7 @@ def run_rule(rule, command, history, settings):
def alias():
print("\nalias fuck='eval $(thefuck $(fc -ln -1))'\n")
print(shells.app_alias())
def main():

View File

@ -31,6 +31,9 @@ class Generic(object):
"""Prepares command for running in shell."""
return command_script
def app_alias(self):
return "\nalias fuck='eval $(thefuck $(fc -ln -1))'\n"
class Bash(Generic):
def _parse_alias(self, alias):
@ -78,3 +81,7 @@ def from_shell(command):
def to_shell(command):
return _get_shell().to_shell(command)
def app_alias():
return _get_shell().app_alias()