mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-21 10:15:14 +08:00
Make type -a print all executables in PATH
This commit is contained in:
parent
afb9401fc7
commit
4a6592597a
@ -117,22 +117,29 @@ function type --description "Print the type of a command"
|
||||
|
||||
end
|
||||
|
||||
set -l path (which $i ^/dev/null)
|
||||
if test -x (echo $path)
|
||||
set res 0
|
||||
set found 1
|
||||
switch $mode
|
||||
case normal
|
||||
printf (_ '%s is %s\n') $i $path
|
||||
set -l paths
|
||||
if test $selection != multi
|
||||
set paths (which $i ^/dev/null)
|
||||
else
|
||||
set paths (which -a $i ^/dev/null)
|
||||
end
|
||||
for path in $paths
|
||||
if test -x (echo $path)
|
||||
set res 0
|
||||
set found 1
|
||||
switch $mode
|
||||
case normal
|
||||
printf (_ '%s is %s\n') $i $path
|
||||
|
||||
case type
|
||||
echo (_ 'file')
|
||||
|
||||
case path
|
||||
echo $path
|
||||
end
|
||||
if test $selection != multi
|
||||
continue
|
||||
end
|
||||
if test $selection != multi
|
||||
continue
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user