mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 20:38:54 +00:00
#N/A: Remove deprecated thefuck-alias
entry point
This commit is contained in:
parent
46cb87615e
commit
1f75fc1ea9
1
setup.py
1
setup.py
@ -51,5 +51,4 @@ setup(name='thefuck',
|
|||||||
extras_require=extras_require,
|
extras_require=extras_require,
|
||||||
entry_points={'console_scripts': [
|
entry_points={'console_scripts': [
|
||||||
'thefuck = thefuck.main:main',
|
'thefuck = thefuck.main:main',
|
||||||
'thefuck-alias = thefuck.main:print_alias',
|
|
||||||
'fuck = thefuck.main:how_to_configure_alias']})
|
'fuck = thefuck.main:how_to_configure_alias']})
|
||||||
|
@ -4,7 +4,6 @@ from .system import init_output
|
|||||||
init_output()
|
init_output()
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from warnings import warn
|
|
||||||
from pprint import pformat
|
from pprint import pformat
|
||||||
import sys
|
import sys
|
||||||
from . import logs, types
|
from . import logs, types
|
||||||
@ -37,17 +36,13 @@ def fix_command():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def print_alias(entry_point=True):
|
def print_alias():
|
||||||
"""Prints alias for current shell."""
|
"""Prints alias for current shell."""
|
||||||
if entry_point:
|
try:
|
||||||
warn('`thefuck-alias` is deprecated, use `thefuck --alias` instead.')
|
alias = sys.argv[2]
|
||||||
position = 1
|
except IndexError:
|
||||||
else:
|
alias = get_alias()
|
||||||
position = 2
|
|
||||||
|
|
||||||
alias = get_alias()
|
|
||||||
if len(sys.argv) > position:
|
|
||||||
alias = sys.argv[position]
|
|
||||||
print(shell.app_alias(alias))
|
print(shell.app_alias(alias))
|
||||||
|
|
||||||
|
|
||||||
@ -76,8 +71,9 @@ def main():
|
|||||||
nargs='*',
|
nargs='*',
|
||||||
help='command that should be fixed')
|
help='command that should be fixed')
|
||||||
known_args = parser.parse_args(sys.argv[1:2])
|
known_args = parser.parse_args(sys.argv[1:2])
|
||||||
|
|
||||||
if known_args.alias:
|
if known_args.alias:
|
||||||
print_alias(False)
|
print_alias()
|
||||||
elif known_args.command:
|
elif known_args.command:
|
||||||
fix_command()
|
fix_command()
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user