File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change
1
+ Add support for Powershell autocompletion.
Original file line number Diff line number Diff line change 47
47
"posh" ,
48
48
"""\
49
49
if ((Test-Path Function:\\ TabExpansion) -and -not `
50
- (Test-Path Function:\\ _pip_completeBackup)) {{
50
+ (Test-Path Function:\\ _pip_completeBackup)) {
51
51
Rename-Item Function:\\ TabExpansion _pip_completeBackup
52
- }}
53
- function TabExpansion($line, $lastWord) {{
52
+ }
53
+ function TabExpansion($line, $lastWord) {
54
54
$lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart()
55
- if ($lastBlock.StartsWith("{prog} ")) { {
55
+ if ($lastBlock.StartsWith("pip ")) {
56
56
$Env:COMP_WORDS=$lastBlock
57
57
$Env:COMP_CWORD=$lastBlock.Split().Length - 1
58
58
$Env:PIP_AUTO_COMPLETE=1
59
- (& {prog} ).Split()
59
+ (& pip ).Split()
60
60
Remove-Item Env:COMP_WORDS
61
61
Remove-Item Env:COMP_CWORD
62
62
Remove-Item Env:PIP_AUTO_COMPLETE
63
- }}
64
- elseif (Test-Path Function:\\ _pip_completeBackup) {{
63
+ }
64
+ elseif (Test-Path Function:\\ _pip_completeBackup) {
65
65
# Fall back on existing tab expansion
66
66
_pip_completeBackup $line $lastWord
67
- }}
68
- }} """ ,
67
+ }
68
+ }""" ,
69
69
),
70
70
)
71
71
You can’t perform that action at this time.
0 commit comments