Shell auto completion should also auto complete short options #4954
Labels
auto-locked
Outdated issues that have been locked by automation
C: autocomplete
Autocompletion in shells (pip completion)
type: enhancement
Improvements to functionality
Description:
Pip's shell auto completion doesn't auto complete short options. The relevant code is:
pip/src/pip/_internal/__init__.py
Lines 130 to 131 in 729990c
Which uses: cpython/Lib/optparse.py:752-756 which returns only the long option, if it's defined.
As a further limitation, which I'm not sure is triggered by Pip's auto completion, is that this will only autocomplete the first long option defined for an option that has multiple long options.
If it's acceptable, we can use the
_short_opts
and_long_opts
attributes to calculate the completions so that we get all short and long options. What do you think?What I've run:
The text was updated successfully, but these errors were encountered: