mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 03:51:20 -03:00
type: Remove need for which
This should be completely equivalent without needing an external command.
This commit is contained in:
@@ -123,7 +123,13 @@ function type --description "Print the type of a command"
|
|||||||
if test $multi != yes
|
if test $multi != yes
|
||||||
set paths (command -s -- $i)
|
set paths (command -s -- $i)
|
||||||
else
|
else
|
||||||
set paths (command which -a -- $i ^/dev/null)
|
# TODO: This should really be `command -sa`.
|
||||||
|
# TODO: If #3914 ('Treat empty $PATH component as equivalent to "." ')
|
||||||
|
# is implemented, this needs to change as well.
|
||||||
|
for file in $PATH/*
|
||||||
|
test -x $file -a ! -d $file
|
||||||
|
and set paths $paths $file
|
||||||
|
end
|
||||||
end
|
end
|
||||||
for path in $paths
|
for path in $paths
|
||||||
set res 0
|
set res 0
|
||||||
|
|||||||
Reference in New Issue
Block a user