Merge branch 'issue-221-tf-alias' of https://github.com/scorphus/thefuck into scorphus-issue-221-tf-alias

This commit is contained in:
nvbn
2015-06-16 13:49:17 +03:00
4 changed files with 76 additions and 24 deletions
+4 -2
View File
@@ -2,7 +2,7 @@ from difflib import get_close_matches
import os
from pathlib import Path
from thefuck.utils import sudo_support
from thefuck.shells import get_aliases
from thefuck.shells import thefuck_alias, get_aliases
def _safe(fn, fallback):
@@ -13,10 +13,12 @@ def _safe(fn, fallback):
def _get_all_callables():
tf_alias = thefuck_alias()
return [exe.name
for path in os.environ.get('PATH', '').split(':')
for exe in _safe(lambda: list(Path(path).iterdir()), [])
if not _safe(exe.is_dir, True)] + get_aliases()
if not _safe(exe.is_dir, True)] + [
alias for alias in get_aliases() if alias != tf_alias]
@sudo_support