executed.
This is a logical change. If the command is `pip install ...`, then you
don't need to look for `python -m pip install ...` in the same command.
Either you have `pip install ...` or `python -m pip install ...`
or something completely different.
The tests showed that the original implementation actually never worked.
You did NOT get a rehash after doing pip3.8 install, even when the
comments in the code said so.
--> replaced `\d` with [0-9] and slapped on a `+`, such that we match
both pip3.x and `pip3.xx install`
Instead of creating a for-loop where we go through each argument, to
check if current argument is -m and next argument is pip, we instead do
simple regex matching where we look for ` -m pip ` somewhere in the
command which is to be executed.
When doing `pip install ...`, the command is redirected to
`pyenv.d/exec/pip-rehash/pip`, which does a `pyenv rehash` after
installation. A simple fix to issue #3031 is to make `python -m pip`
commands go through the same special hook script.
All scripts in libexec/ (excluding pyenv) are called through pyenv,
therefore the shebang lines are not necessary. On some systems this
provides a measurable increase in performance of the shell prompt.
Related to pyenv/pyenv-virtualenv#259