mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00: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
1 changed files with 5 additions and 2 deletions
|
@ -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 a new issue