-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
Add "search -u" to use a module if there's only one result #11652
Conversation
…asy step This implements a feature request from a few years back, adding a numeric column to module search, as well as a '-u' option that automatically uses the first module that matches, or if the user specifies a number value, the nth module that matches.
Is there a default sorting, if so what is it? Edit (after reading the use case): |
I was thinking you'd |
This could be improved with some sort of default sorting, but you're right in that there's no guarantee that '-u N' will continue resolving to a particular module over time, even if there is sorting. What do you think, is this a reasonable implementation, or should I try an entirely different approach? |
I don't have a better answer than this. The only other thought that came to mind is somehow caching the search result then doing a I can see the tickets now though "i used some tutorial and it said |
If I were using this feature, I'd like to be able to do I don't like the use-by-index approach. I agree with @h00die's consideration that tutorials will perpetuate the wrong information. I would still keep the index column, though. |
Release NotesThe |
Marking |
This implements a feature request from a few years back, adding a numeric column to module search, as well as a '-u' option that automatically uses the first module that matches, or if the user specifies a number value, the nth module that matches.
Fixes #4336
Example:
Counterexample: