From 4d909b1c199bf71ff1e76bb9e2e31ad04c94b8dd Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Mon, 18 Jun 2018 23:53:36 -0500 Subject: [PATCH] Add partial completions for curl, supporting @file syntax Allows the most painful of curl's arguments to be completed by fish by restoring file-based completions for paths prefixed with `@` (which are typically used after parameters like --data). --- share/completions/curl.fish | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 share/completions/curl.fish diff --git a/share/completions/curl.fish b/share/completions/curl.fish new file mode 100644 index 000000000..1100e4c29 --- /dev/null +++ b/share/completions/curl.fish @@ -0,0 +1,6 @@ +# mqudsi: Given the size and scope of curl's arguments, I don't have the time +# to add proper completions, but want to enable path completion for data file +# parameters, which allow specifying the path to a payload to upload as @path, +# which fish won't complete otherwise. + +complete -c curl -n 'string match -qr "^@" -- (commandline -ct)' -xa "(printf '%s\n' -- @(__fish_complete_suffix (commandline -ct | string replace -r '^@' '') ''))"