1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-07-25 16:29:46 +01:00
Files
tests
thefuck
rules
__init__.py
apt_get.py
brew_install.py
brew_unknown_command.py
brew_upgrade.py
cargo.py
cargo_no_command.py
cd_correction.py
cd_mkdir.py
cd_parent.py
composer_not_command.py
cp_omitting_directory.py
cpp11.py
dirty_untar.py
dirty_unzip.py
django_south_ghost.py
django_south_merge.py
docker_not_command.py
dry.py
fix_alt_space.py
git_add.py
git_branch_delete.py
git_branch_list.py
git_checkout.py
git_diff_staged.py
git_fix_stash.py
git_not_command.py
git_pull.py
git_pull_clone.py
git_push.py
git_push_force.py
git_push_pull.py
git_stash.py
go_run.py
grep_recursive.py
gulp_not_task.py
has_exists_script.py
heroku_not_command.py
history.py
java.py
javac.py
lein_not_task.py
ls_lah.py
man.py
man_no_space.py
mercurial.py
mkdir_p.py
no_command.py
no_such_file.py
open.py
pacman.py
pip_unknown_command.py
python_command.py
python_execute.py
quotation_marks.py
rm_dir.py
rm_root.py
sed_unterminated_s.py
sl_ls.py
ssh_known_hosts.py
sudo.py
switch_lang.py
systemctl.py
test.py.py
tmux.py
tsuru_login.py
whois.py
__init__.py
conf.py
logs.py
main.py
shells.py
types.py
utils.py
.gitignore
.travis.yml
LICENSE.md
MANIFEST.in
README.md
example.gif
release.py
requirements.txt
setup.cfg
setup.py
tox.ini
thefuck/thefuck/rules/pip_unknown_command.py
2015-07-24 00:39:56 +03:00

17 lines
526 B
Python

import re
from thefuck.utils import replace_argument
def match(command, settings):
return ('pip' in command.script and
'unknown command' in command.stderr and
'maybe you meant' in command.stderr)
def get_new_command(command, settings):
broken_cmd = re.findall(r'ERROR: unknown command \"([a-z]+)\"',
command.stderr)[0]
new_cmd = re.findall(r'maybe you meant \"([a-z]+)\"', command.stderr)[0]
return replace_argument(command.script, broken_cmd, new_cmd)