fish-shell/share/functions/__fish_md5.fish
Fabian Homborg 9367d4ff71 Reindent functions to remove useless quotes
This does not include checks/function.fish because that currently
includes a "; end" in a message that indent would remove, breaking the test.
2020-03-09 19:46:43 +01:00

29 lines
734 B
Fish

function __fish_md5
if type -q md5sum
# GNU systems
if set -q argv[2]
if test $argv[1] = -s
echo (echo $argv[2] | md5sum | string split ' ')[1]
else
printf (_ "%s: Too many arguments %s\n") fish_md5 $argv
end
else
echo (md5sum $argv[1] | string split ' ')[1]
end
return 0
else if type -q md5
# BSD systems
if set -q argv[2]
if test $argv[1] = -s
md5 -s $argv[1]
else
printf (_ "%s: Too many arguments %s\n") fish_md5 $argv
end
else
md5 -q $argv[1]
end
return 0
end
return 1
end