oils-for-unix / oils

Oils is our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!
http://www.oilshell.org/
Other
2.85k stars 159 forks source link

command -v should print the full path of the executable #2093

Closed ale5000-git closed 1 month ago

ale5000-git commented 1 month ago

Oils 0.23.0 installed with brew install --quiet oils-for-unix.

Example:

$ osh -c 'command -v osh'; echo $?
osh
0
$ osh -c 'command -V osh'; echo $?
osh is /opt/homebrew/bin/osh
0
$ osh -c 'type osh'; echo $?
osh is /opt/homebrew/bin/osh
0
$ osh -c 'which osh'; echo $?
/opt/homebrew/bin/osh
0
$ ls -l /opt/homebrew/bin/osh
lrwxr-xr-x  1 runner  admin  38 Oct  8 19:26 /opt/homebrew/bin/osh -> ../Cellar/oils-for-unix/0.23.0/bin/osh

How you can see only command -v miss the path. Can it be fixed please?

andychu commented 1 month ago

OK yes I see the difference, thanks for the report!

$ bash -c 'command -v osh'
/usr/local/bin/osh

$ osh -c 'command -v osh'
osh
andychu commented 1 month ago

I just pushed a fix for this - it will be out in the next release

Thanks for the report!

ale5000-git commented 1 month ago

Thanks to you for the fix.