Skip to content

Commit b238343

Browse files
committed
prefer the full name of powershell
1 parent 29edec5 commit b238343

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/html/user_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ To setup for fish::
745745

746746
To setup for powershell::
747747

748-
python -m pip completion --posh | Out-File -Encoding default -Append $PROFILE
748+
python -m pip completion --powershell | Out-File -Encoding default -Append $PROFILE
749749

750750
Alternatively, you can use the result of the ``completion`` command directly
751751
with the eval function of your shell, e.g. by adding the following to your

src/pip/_internal/commands/completion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
end
4949
complete -fa "(__fish_complete_pip)" -c {prog}
5050
""",
51-
'posh': """
51+
'powershell': """
5252
if ((Test-Path Function:\\TabExpansion) -and -not `
5353
(Test-Path Function:\\_pip_completeBackup)) {{
5454
Rename-Item Function:\\TabExpansion _pip_completeBackup
@@ -99,9 +99,9 @@ def add_options(self):
9999
dest='shell',
100100
help='Emit completion code for fish')
101101
self.cmd_opts.add_option(
102-
'--posh', '-p',
102+
'--powershell', '-p',
103103
action='store_const',
104-
const='posh',
104+
const='powershell',
105105
dest='shell',
106106
help='Emit completion code for powershell')
107107

tests/functional/test_completion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null ))
3535
}
3636
compctl -K _pip_completion pip"""),
37-
('posh', """\
37+
('powershell', """\
3838
if ((Test-Path Function:\\TabExpansion) -and -not `
3939
(Test-Path Function:\\_pip_completeBackup)) {
4040
Rename-Item Function:\\TabExpansion _pip_completeBackup
@@ -129,7 +129,7 @@ def test_completion_alone(autocomplete_script):
129129
Test getting completion for none shell, just pip completion
130130
"""
131131
result = autocomplete_script.pip('completion', allow_stderr_error=True)
132-
assert 'ERROR: You must pass --bash or --fish or --posh or --zsh' \
132+
assert 'ERROR: You must pass --bash or --fish or --powershell or --zsh' \
133133
in result.stderr, 'completion alone failed -- ' + result.stderr
134134

135135

@@ -325,7 +325,7 @@ def test_completion_path_after_option(autocomplete, data):
325325
)
326326

327327

328-
@pytest.mark.parametrize('flag', ['--bash', '--zsh', '--fish', '--posh'])
328+
@pytest.mark.parametrize('flag', ['--bash', '--zsh', '--fish', '--powershell'])
329329
def test_completion_uses_same_executable_name(
330330
autocomplete_script, flag, deprecated_python
331331
):

0 commit comments

Comments
 (0)