Skip to content

Commit

Permalink
completition(fish): add back ; as line endings in fish script
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdragun committed Jul 19, 2023
1 parent f3d9202 commit 8742cbe
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/click/shell_completion.py
Expand Up @@ -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)";
"""


Expand Down

0 comments on commit 8742cbe

Please sign in to comment.