Commit Graph

9 Commits

Author SHA1 Message Date
Fabian Boehm
b4d9189fd3 Cache pip{,2,3,env} completions
These take a *lot* of time - `pip3` takes 180ms, `pipenv` takes 320ms
on my system.

Note that this removes a number of obsolete workarounds - pip's was
fixed in 2017 (and pip2 is less and less of a thing), pipenv's change
was in 2019.

Since these are packaging tools with access to the internet they
should really be kept up-to-date, so it is unlikely someone still uses
these old versions.
2024-01-21 14:18:50 +01:00
exploide
3e3996c9a5 completions pipenv: made pipenv completions compatible with recent versions
pipenv switched from older click-completion package to new built-in completions
from click framework in v2021.11.9.
This command achieves compatibility with both, older and more recent versions.
2022-09-09 18:47:24 +02:00
Clément Martinez
cbc40842e2 Complete pipenv run 2020-10-25 17:18:42 -05:00
Fabian Homborg
69b464bc37 Run fish_indent on all our fish scripts
It's now good enough to do so.

We don't allow grid-alignment:

```fish
complete -c foo -s b -l barnanana -a '(something)'
complete -c foo -s z              -a '(something)'
```

becomes

```fish
complete -c foo -s b -l barnanana -a '(something)'
complete -c foo -s z -a '(something)'
```

It's just more trouble than it is worth.

The one part I'd change:

We align and/or'd parts of an if-condition with the in-block code:

```fish
if true
   and false
    dosomething
end
```

becomes

```fish
if true
    and false
    dosomething
end
```

but it's not used terribly much and if we ever fix it we can just
reindent.
2020-01-13 20:34:22 +01:00
Fabian Homborg
0e0d63c0df completions/pipenv: Really force it to print fish completions
"To assume" and such.

It doesn't check $SHELL, so it might have some other automagic that
can fail (probably still because of the login shell, but I have no
idea).

Override the special variable that
click-completion (https://github.com/click-contrib/click-completion)
uses to force it instead.

Really fixes #6454.

[ci skip]
2019-12-25 16:29:10 +01:00
Fabian Homborg
aba5beaeb4 completions/pipenv: Force it to print fish completions
This checks $SHELL to determine which completions to print, and $SHELL
is typically set by your login program.

So if the login shell isn't fish, this will print the wrong
completions.

Fixes #6454

[ci skip]
2019-12-25 16:16:08 +01:00
Fabian Homborg
d8b1f0715f [pip* completions] Silence stderr
For some reason, these tools print an upgrade message to stderr, even
when stdout goes somewhere else.
2018-05-03 11:32:18 +02:00
Aaron Gyes
d740b2a473 pip completions: use builtin source rather than eval function. 2017-10-04 21:50:09 -07:00
Cristian Prieto
1770e47eb0 Python's pip and pipenv completions (#4448)
* 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
2017-10-04 21:15:41 -07:00