File tree 1 file changed +9
-4
lines changed
src/cleo/commands/completions 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 122
122
%(cmds_opts)s"""
123
123
124
124
125
- POWERSHELL_TEMPLATE = """\
125
+ POWERSHELL_TEMPLATE = (
126
+ """\
126
127
$%(function)s = {
127
128
param(
128
129
[string] $wordToComplete,
133
134
$options = %(opts)s
134
135
$commands = %(cmds)s
135
136
136
- if ($wordToComplete -notlike '--*' -and $wordToComplete -notlike "" -and ($commandAst.CommandElements.Count -eq "2")) {
137
+ if ($wordToComplete -notlike '--*' -and $wordToComplete -notlike "" -and """
138
+ """($commandAst.CommandElements.Count -eq "2")) {
137
139
return $commands | Where-Object { $_ -like "$wordToComplete*" }
138
140
}
139
141
140
- $result = $commandAst.CommandElements | Select-Object -Skip 1 | Where-Object { $_ -notlike '--*' }
142
+ $result = $commandAst.CommandElements | Select-Object -Skip 1 | """
143
+ """Where-Object { $_ -notlike '--*' }
141
144
switch ($result -Join " " ) {
142
145
%(cmds_opts)s
143
146
}
144
147
145
148
return $options | Where-Object { $_ -like "$wordToComplete*" }
146
149
}
147
150
148
- Register-ArgumentCompleter -Native -CommandName %(script_name)s -ScriptBlock $%(function)s"""
151
+ Register-ArgumentCompleter -Native -CommandName %(script_name)s """
152
+ """-ScriptBlock $%(function)s"""
153
+ )
149
154
150
155
TEMPLATES = {
151
156
"bash" : BASH_TEMPLATE ,
You can’t perform that action at this time.
0 commit comments