mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-30 22:34:29 +08:00
573c539956
* Implement https://github.com/hanny24/gradle-fish/blob/master/gradle.load * Use XDG_CACHE_HOME * Use __funced_md5 * Fix fish_md5.fish * Actually use the new function. * Use string match for matching tasks * I goofed. Actually pass a string to complete -a * Fix attempt to remove needed function... * Fix regex * Fix fish_md5.fish to use a flag
29 lines
736 B
Fish
29 lines
736 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
|