diff --git a/thefuck/main.py b/thefuck/main.py index 8a2fd3a1..0a62d457 100644 --- a/thefuck/main.py +++ b/thefuck/main.py @@ -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(): diff --git a/thefuck/shells.py b/thefuck/shells.py index b0fdc7ac..a9bc7cb5 100644 --- a/thefuck/shells.py +++ b/thefuck/shells.py @@ -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()