completion.pl: add completion for paths after @ for fish

Closes #15928
This commit is contained in:
Asger Hautop Drewsen 2025-01-07 15:56:52 +01:00 committed by Daniel Stenberg
parent 1ae47b91a3
commit cacceef5a6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -43,6 +43,9 @@ my @opts = parse_main_opts('--help all', $regex);
if ($shell eq 'fish') {
print "# curl fish completion\n\n";
print "# Complete file paths after @\n";
print q(complete -c curl -n 'string match -qr "^@" -- (commandline -ct)' -k -xa "(printf '%s\n' -- @(__fish_complete_suffix --complete=(commandline -ct | string replace -r '^@' '') ''))");
print "\n\n";
print qq{$_ \n} foreach (@opts);
} elsif ($shell eq 'zsh') {
my $opts_str;