diff --git a/thefuck/main.py b/thefuck/main.py index 235784b8..20cb6c0b 100644 --- a/thefuck/main.py +++ b/thefuck/main.py @@ -114,6 +114,12 @@ def is_second_run(command): """Is it the second run of `fuck`?""" return command.script.startswith('fuck') +def check_show_alias(argv): + """Was thefuck called with --bash-alias?""" + if "--bash-alias" in sys.argv: + print("\nalias fuck='eval $(thefuck $(fc -ln -1))'\n"); + return True + return False def alias(): print("\nalias fuck='eval $(thefuck $(fc -ln -1))'\n") @@ -124,6 +130,9 @@ def main(): user_dir = setup_user_dir() settings = conf.get_settings(user_dir) + if check_show_alias(sys.argv): + return + command = get_command(settings, sys.argv) if command: if is_second_run(command):