From 3c1529e6bc12118ff5a83b2f81fc52f625367736 Mon Sep 17 00:00:00 2001 From: Peter Dragun Date: Wed, 19 Jul 2023 09:06:03 +0200 Subject: [PATCH] add back semicolons in fish script --- src/click/shell_completion.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/click/shell_completion.py b/src/click/shell_completion.py index af4a57a23..dc9e00b9b 100644 --- a/src/click/shell_completion.py +++ b/src/click/shell_completion.py @@ -167,25 +167,25 @@ def __getattr__(self, name: str) -> t.Any: """ _SOURCE_FISH = """\ -function %(complete_func)s +function %(complete_func)s; set -l response (env %(complete_var)s=fish_complete COMP_WORDS=(commandline -cp) \ -COMP_CWORD=(commandline -t) %(prog_name)s) +COMP_CWORD=(commandline -t) %(prog_name)s); - for completion in $response - set -l metadata (string split "," $completion) + for completion in $response; + set -l metadata (string split "," $completion); - if test $metadata[1] = "dir" - __fish_complete_directories $metadata[2] - else if test $metadata[1] = "file" - __fish_complete_path $metadata[2] - else if test $metadata[1] = "plain" - echo $metadata[2] - end - end -end + if test $metadata[1] = "dir"; + __fish_complete_directories $metadata[2]; + else if test $metadata[1] = "file"; + __fish_complete_path $metadata[2]; + else if test $metadata[1] = "plain"; + echo $metadata[2]; + end; + end; +end; complete --no-files --command %(prog_name)s --arguments \ -"(%(complete_func)s)" +"(%(complete_func)s)"; """