mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 08:56:43 +08:00
Make the type builtin not rely on the exit status of the which command
darcs-hash:20060314000641-ac50b-cc92a519b6c8981a50aea0f25f407dfe2b5f51dc.gz
This commit is contained in:
parent
83d05f9170
commit
5f3ad87a98
|
@ -105,12 +105,15 @@ function type -d (N_ "Print the type of a command")
|
|||
|
||||
end
|
||||
|
||||
if which $i ^/dev/null >/dev/null
|
||||
set -l path (which $i ^/dev/null)
|
||||
set -l path_ok 0
|
||||
count $path >/dev/null; and test -x $path; and set -l path_ok 1
|
||||
if test $path_ok = 1
|
||||
set status 0
|
||||
set found 1
|
||||
switch $mode
|
||||
case normal
|
||||
printf (_ '%s is %s\n') $i (which $i)
|
||||
printf (_ '%s is %s\n') $i $path
|
||||
|
||||
case type
|
||||
printf (_ 'file\n')
|
||||
|
|
Loading…
Reference in New Issue
Block a user