fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerReformat share/{completions,functions}c12f853db

master
625 B13 linesraw
1if set -l rclone_version (rclone version | string match -rg 'rclone v?(.*)' | string split .) &&
2        test "$rclone_version[1]" -lt 1 ||
3        test "$rclone_version[1]" -eq 1 &&
4        test "$rclone_version[2]" -le 62
5    # version is definitely <= 1.62, adding a `-` would be an error
6    rclone completion fish
7else
8    # For newer versions, this requires an `-`. Without a `-`, it would
9    # try to write to /etc/completions/fish.
10    # If we can't determine the version, assume a recent one. An error
11    # is better than trying to write to /etc unexpectedly.
12    rclone completion fish -
13end 2>/dev/null | source