File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/cleo/commands/completions Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 122122%(cmds_opts)s"""
123123
124124
125- POWERSHELL_TEMPLATE = """\
125+ POWERSHELL_TEMPLATE = (
126+ """\
126127 $%(function)s = {
127128 param(
128129 [string] $wordToComplete,
133134 $options = %(opts)s
134135 $commands = %(cmds)s
135136
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")) {
137139 return $commands | Where-Object { $_ -like "$wordToComplete*" }
138140 }
139141
140- $result = $commandAst.CommandElements | Select-Object -Skip 1 | Where-Object { $_ -notlike '--*' }
142+ $result = $commandAst.CommandElements | Select-Object -Skip 1 | """
143+ """Where-Object { $_ -notlike '--*' }
141144 switch ($result -Join " " ) {
142145%(cmds_opts)s
143146 }
144147
145148 return $options | Where-Object { $_ -like "$wordToComplete*" }
146149}
147150
148- Register-ArgumentCompleter -Native -CommandName %(script_name)s -ScriptBlock $%(function)s"""
151+ Register-ArgumentCompleter -Native -CommandName %(script_name)s """
152+ """-ScriptBlock $%(function)s"""
153+ )
149154
150155TEMPLATES = {
151156 "bash" : BASH_TEMPLATE ,
You can’t perform that action at this time.
0 commit comments