1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-05 18:31:10 +01:00

#294 Move entry point for alias to main

This commit is contained in:
nvbn 2015-07-20 21:14:43 +03:00
parent a849b65352
commit 1b961c4b87
3 changed files with 12 additions and 7 deletions

View File

@ -31,4 +31,4 @@ setup(name='thefuck',
extras_require=extras_require,
entry_points={'console_scripts': [
'thefuck = thefuck.main:main',
'thefuck-alias = thefuck.shells:app_alias']})
'thefuck-alias = thefuck.main:print_alias']})

View File

@ -128,6 +128,8 @@ def run_rule(rule, command, settings):
print(new_command)
# Entry points:
def main():
colorama.init()
user_dir = setup_user_dir()
@ -151,3 +153,10 @@ def main():
return
logs.failed('No fuck given', settings)
def print_alias():
alias = shells.thefuck_alias()
if len(sys.argv) > 1:
alias = sys.argv[1]
print(shells.app_alias(alias))

View File

@ -9,7 +9,6 @@ from subprocess import Popen, PIPE
from time import time
import io
import os
import sys
from .utils import DEVNULL, memoize
@ -242,11 +241,8 @@ def to_shell(command):
return _get_shell().to_shell(command)
def app_alias():
alias = thefuck_alias()
if len(sys.argv) > 1:
alias = sys.argv[1]
print(_get_shell().app_alias(alias))
def app_alias(alias):
return _get_shell().app_alias(alias)
def thefuck_alias():