Since 4414d5c888 (in fish 3.0.0) we
don't autoload completions if the command doesn't exist.
So there is no need to check inside the scripts anymore.
Whats more, a few (like pip and cabal) checked `command -q` instead of
`type -q`, meaning they'd fail if someone used a function instead of a
command of that name.
If the *command* actually needs to exist, checks like that are still
warranted, like in `npm` where aliasing it to `nvm` is popular.
A teensy additional bit: Make `sysctl -w` the same as `sysctl
--write`. That description was bogus.
\b does not match "end of spaces" but rather "start of a-z/0-9" and so
does not match the start of string '-c'. Match (and then re-insert) a
literal ' ' as part of the pattern instead.
Work around bug pypa/pip#4755
Don't expect all users to be running a version of pip2/3 that includes
the fix (once it's upstreamed). Will continue to work if/when pip2/3
emit the correct output. pip is already very slow at printing the
completions (see #4448) so the `sed` call overhead is neglible.
* Add pip completion
* We call native pip completion for fish if pip is installed
* Add pipenv completion
* We call pipenv native completion if pipenv is installed
* Applied changes as requested by @floam
* Changed usage of `test (command -v)` for just `command -sq`
* Add completions for pip2/3
* In some systems pip is not aliased and we have pip2 and pip3
* In those cases, we just load the completions for those commands
* Separate pip2/3 completions in their own file as requested by @floam