-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
make it easy to learn where a function came from #3295
Comments
We already track which functions are autoloaded. It would be straightforward to report that fact in the |
This would enable a |
I've created PR #3718 that implements the enhancement described above to the |
I can see that. You've implemented this in a function called "show_function_details", so how about "--details" or "--show-details"? Of course it couldn't use "-d" since that's already taken for changing the description, so it would have to be "-D". Or simply call it "--verbose" and either support passing it twice ( Or since this is metadata, something with that term? |
A I'm also considering putting the metadata in a comment at the top of the |
Oops! The text that used to be this comment was meant for a different issue. |
I've changed my mind about augmenting the |
I'm very behind, but is it too late to rename this to |
Yes, since this feature is in the 2.5.0 release. Granted it is very unlikely anyone is yet using this feature but since the change would be purely aesthetic (i.e., gratuitous) it's pretty hard to justify. |
2e38cf2 isn't in 2.5.0, so I think we've still got the chance. |
Yep, you're right, @zanchey. I had synced my 2.5.0 client to the wrong commit because I did it by hand rather than As for We're going to need feedback from a couple more people since we each prefer different terms and it's not obvious that one of them, or perhaps a different term we haven't thought of, is superior. |
I prefer |
I think |
Okay, but many other commands use Both of us are obviously arguing from extremely limited data sets. So I think it makes more sense to argue from first principals rather than what is most popular. As I said earlier I think At the end of the day I think we're arguing whether it is "tomato" or "tomatoe". What the flag causes to be output is fundamentally metadata as the term is used by most people in the IT industry. But if that is deemed too esoteric, especially for people for whom English is a second language, then |
Yes, I think it's too esoteric. I've looked at the information it provides and I wonder if |
Since I had only a very weak preference for |
We regularly get questions about unexpected behavior whose investigation involves verifying that the expected fish functions are being loaded. For example, issue #3210. It should be much easier to answer that question. A first approximation solution is to do something like
The problem with that solution is there is no guarantee the function came from the corresponding autoload script.
I propose two enhancements. First, augment the
builtin functions
command to take a function name and report where it came from. Second, augment thetype
function to report all the corresponding autoload scripts using something like the snippet above. It seems liketype -P $func_name
should be enhanced to report the first autoload script found or all of them if-a
is also specified. It's not clear why the current behavior only deals with external commands and not autoloaded functions. If changingtype -P
to also handle autoloaded functions is too confusing, or likely to break existing uses, then we could add an analogous-F
option to find autoload scripts rather than external commands.The text was updated successfully, but these errors were encountered: