mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-14 06:38:32 +00:00
Added the --bash-alias command to output the correct alias line to add to your .bashrc so you can call it like:
thefuck --bash-alias >> ~/.bashrc
This commit is contained in:
parent
419878f526
commit
fc3ef654b6
@ -111,12 +111,21 @@ 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 main():
|
||||
colorama.init()
|
||||
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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user