Skip to content

Commit 4fdffa2

Browse files
committed
add a news file
1 parent 0f1a9d7 commit 4fdffa2

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

news/9024.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for Powershell autocompletion.

tests/functional/test_completion.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,25 @@
4747
"posh",
4848
"""\
4949
if ((Test-Path Function:\\TabExpansion) -and -not `
50-
(Test-Path Function:\\_pip_completeBackup)) {{
50+
(Test-Path Function:\\_pip_completeBackup)) {
5151
Rename-Item Function:\\TabExpansion _pip_completeBackup
52-
}}
53-
function TabExpansion($line, $lastWord) {{
52+
}
53+
function TabExpansion($line, $lastWord) {
5454
$lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart()
55-
if ($lastBlock.StartsWith("{prog} ")) {{
55+
if ($lastBlock.StartsWith("pip ")) {
5656
$Env:COMP_WORDS=$lastBlock
5757
$Env:COMP_CWORD=$lastBlock.Split().Length - 1
5858
$Env:PIP_AUTO_COMPLETE=1
59-
(& {prog}).Split()
59+
(& pip).Split()
6060
Remove-Item Env:COMP_WORDS
6161
Remove-Item Env:COMP_CWORD
6262
Remove-Item Env:PIP_AUTO_COMPLETE
63-
}}
64-
elseif (Test-Path Function:\\_pip_completeBackup) {{
63+
}
64+
elseif (Test-Path Function:\\_pip_completeBackup) {
6565
# Fall back on existing tab expansion
6666
_pip_completeBackup $line $lastWord
67-
}}
68-
}}""",
67+
}
68+
}""",
6969
),
7070
)
7171

0 commit comments

Comments
 (0)