mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Avoid invoking extra subshell in __fish_md5
This commit is contained in:
parent
aa1a390504
commit
0a6e8468cc
1 changed files with 2 additions and 2 deletions
|
@ -3,12 +3,12 @@ function __fish_md5
|
||||||
# GNU systems
|
# GNU systems
|
||||||
if set -q argv[2]
|
if set -q argv[2]
|
||||||
if test $argv[1] = -s
|
if test $argv[1] = -s
|
||||||
echo (echo $argv[2] | md5sum | string split ' ')[1]
|
echo $argv[2] | md5sum | string split ' ' -f 1
|
||||||
else
|
else
|
||||||
printf (_ "%s: Too many arguments %s\n") fish_md5 $argv >&2
|
printf (_ "%s: Too many arguments %s\n") fish_md5 $argv >&2
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
echo (md5sum $argv[1] | string split ' ')[1]
|
md5sum $argv[1] | string split ' ' -f 1
|
||||||
end
|
end
|
||||||
return 0
|
return 0
|
||||||
else if type -q md5
|
else if type -q md5
|
||||||
|
|
Loading…
Reference in a new issue