-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add nix search --all #4809
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 nix search --all #4809
Conversation
|
Tested using
|
thufschmitt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of small suggestions to extend the documentation and the tests, but otherwise looks good
|
I'm not sure I agree with the premise that not specifying a regex is likely an error.
Every search is a full search. The regex just restricts what gets printed. |
Perhaps not likely for someone familiar with the command, but I would say it is likely an error for new users. Although an empty search is quick, it is inconsistent with most common search commands which assume that every search begins as an empty one. This idiosyncrasy can make even those familiar with the command error prone as shown with #4739, which in the long run can make the feature not so quick. I thought that the short flag '-a' might bridge the gap between being convenient and quick while also demanding explicit user intent for a full search. That way we can stop the unpleasant experience of having the terminal lock up and make the command a little more predictable. |
|
Another way would be to do what Or print info message to stderr, something like: Also flake version of |
|
@sophrosyne97 can you rebase? |
Rebased and tested. |
|
Can you rebase on master and fix the failing test? |
|
@thufschmitt could you review this? |
|
This PR was discussed in the Nix team meeting today:
Decision: close |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-08-11-nix-team-meeting-79/31627/1 |
Since calling nix search without a search string is likely to occur by mistake it should not try to match for all packages.
Given how long particular full searches can take a full match should occur from the '--all' flag.
Instead, empty searches now throw an error to the user.
Closes issues #4739 and #3553
(Note: for #3553 I opted to make nix-search throw an error on an empty search instead of show the help message due to it being an InstallableCommand, which meant that it would only show the help message if there was a flake in the current directory and throw an error otherwise. )