Skip to content

Commit

Permalink
completions/rclone: Add version parsing
Browse files Browse the repository at this point in the history
This had a weird, unnecessary and terrible backwards-incompatibility
in how you get the completions out.

I do not like it but I am in a good enough mood to work around it.

See #9878.
  • Loading branch information
faho committed Jul 15, 2023
1 parent 3d7ad4d commit bfd97ad
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion share/completions/rclone.fish
@@ -1 +1,10 @@
rclone completion fish - | source
set -l rclone_version (rclone version | string match -rg 'rclone v(.*)' | string split .)
or return

# Yes, rclone's parsing here has changed, now they *require* a `-` argument
# where previously they required *not* having it.
if test "$rclone_version[1]" -gt 1; or test "$rclone_version[2]" -gt 62
rclone completion fish - 2>/dev/null | source
else
rclone completion fish 2>/dev/null | source
end

0 comments on commit bfd97ad

Please sign in to comment.