mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 09:39:01 +00:00
Merge fc3ef654b6ff9c29d252b58a98df15e35eec4d6d into fb7376f5a56e04be5dcaa81bcb19599ee650abbe
This commit is contained in:
commit
12c2a42f19
@ -114,6 +114,12 @@ def is_second_run(command):
|
|||||||
"""Is it the second run of `fuck`?"""
|
"""Is it the second run of `fuck`?"""
|
||||||
return command.script.startswith('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():
|
def alias():
|
||||||
print("\nalias fuck='eval $(thefuck $(fc -ln -1))'\n")
|
print("\nalias fuck='eval $(thefuck $(fc -ln -1))'\n")
|
||||||
@ -124,6 +130,9 @@ def main():
|
|||||||
user_dir = setup_user_dir()
|
user_dir = setup_user_dir()
|
||||||
settings = conf.get_settings(user_dir)
|
settings = conf.get_settings(user_dir)
|
||||||
|
|
||||||
|
if check_show_alias(sys.argv):
|
||||||
|
return
|
||||||
|
|
||||||
command = get_command(settings, sys.argv)
|
command = get_command(settings, sys.argv)
|
||||||
if command:
|
if command:
|
||||||
if is_second_run(command):
|
if is_second_run(command):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user