]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
completion.pl: add completion for paths after @ for fish
authorAsger Hautop Drewsen <asger@tyilo.com>
Tue, 7 Jan 2025 14:56:52 +0000 (15:56 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 10 Jan 2025 07:37:55 +0000 (08:37 +0100)
Closes #15928

scripts/completion.pl

index 00c736898a11961dd012e902f220ef63989d5740..dd0c81d35b8078f73eab48554e9c8479fccc5063 100755 (executable)
@@ -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;