Fix curl data string from path completions

Closes #10539.
This commit is contained in:
Mahmoud Al-Qudsi 2024-06-02 21:57:33 -05:00
parent d90d924c8c
commit 9f0e034fad

View File

@ -1,6 +1,11 @@
complete -c curl -n 'string match -qr "^@" -- (commandline -ct)' -k -xa "(printf '%s\n' -- @(__fish_complete_suffix --complete=(commandline -ct | string replace -r '^@' '') ''))"
# Complete paths after @ in options:
function __curl_complete_data
string match -qr '^(?<prefix>.*@)(?<path>.*)' -- (commandline -ct)
printf '%s\n' -- $prefix(__fish_complete_path $path)
end
complete -c curl -n 'string match -qr "@" -- (commandline -ct)' -kxa "(__curl_complete_data)"
# These based on the autogenerated completions.
# The remaining are based off the autogenerated completions.
complete -c curl -l abstract-unix-socket -d '(HTTP) Connect through an abstract Unix domain socket'
complete -c curl -l anyauth -d '(HTTP) Use most secure authentication method automatically'
complete -c curl -s a -l append -d '(FTP SFTP) Upload: append to the target file'