New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the "command" builtin should have a `-a` option to obviate the need for "which" #2778

Closed
krader1961 opened this Issue Feb 29, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@krader1961
Contributor

krader1961 commented Feb 29, 2016

Recently a new contributor, @floam, brought to our attention a problem reported on the fish-users mailing list that occurs if someone creates a function named which that invokes the type builtin. Contributor @faho quickly eliminated the infinite recursion with this change.

I'm opening this issue because I think a better fix is to implement a -a switch for the command builtin. In conjunction with the -s switch that will cause it to return all commands found in $PATH. That makes it a usable replacement for the command which -a -- $i ^/dev/null found in share/functions/type.fish thus avoiding the need to spawn an external command for something fish can easily do itself (and already, mostly, does so).

@krader1961 krader1961 added this to the fish-future milestone Feb 29, 2016

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Feb 29, 2016

Member

I thought about if I should just check $PATH manually in the script. I decided against it at the time because I wasn't sure if that was the entire algorithm, so I went with the simple change.

This is cleaner.

Member

faho commented Feb 29, 2016

I thought about if I should just check $PATH manually in the script. I decided against it at the time because I wasn't sure if that was the entire algorithm, so I went with the simple change.

This is cleaner.

@krader1961 krader1961 self-assigned this Jun 23, 2017

@krader1961 krader1961 modified the milestones: fish 2.7.0, fish-future Jun 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment