From dca6d898b6873a52380aa4006735d73f39e474ed Mon Sep 17 00:00:00 2001 From: Fedor Kuznetsov Date: Tue, 20 Dec 2022 03:21:46 +0500 Subject: [PATCH] Fix line length --- src/cleo/commands/completions/templates.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cleo/commands/completions/templates.py b/src/cleo/commands/completions/templates.py index 6997c85b..88a8b1d0 100644 --- a/src/cleo/commands/completions/templates.py +++ b/src/cleo/commands/completions/templates.py @@ -122,7 +122,8 @@ %(cmds_opts)s""" -POWERSHELL_TEMPLATE = """\ +POWERSHELL_TEMPLATE = ( + """\ $%(function)s = { param( [string] $wordToComplete, @@ -133,11 +134,13 @@ $options = %(opts)s $commands = %(cmds)s - if ($wordToComplete -notlike '--*' -and $wordToComplete -notlike "" -and ($commandAst.CommandElements.Count -eq "2")) { + if ($wordToComplete -notlike '--*' -and $wordToComplete -notlike "" -and """ + """($commandAst.CommandElements.Count -eq "2")) { return $commands | Where-Object { $_ -like "$wordToComplete*" } } - $result = $commandAst.CommandElements | Select-Object -Skip 1 | Where-Object { $_ -notlike '--*' } + $result = $commandAst.CommandElements | Select-Object -Skip 1 | """ + """Where-Object { $_ -notlike '--*' } switch ($result -Join " " ) { %(cmds_opts)s } @@ -145,7 +148,9 @@ return $options | Where-Object { $_ -like "$wordToComplete*" } } -Register-ArgumentCompleter -Native -CommandName %(script_name)s -ScriptBlock $%(function)s""" +Register-ArgumentCompleter -Native -CommandName %(script_name)s """ + """-ScriptBlock $%(function)s""" +) TEMPLATES = { "bash": BASH_TEMPLATE,