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
nix search: allow -A
for attribute-only searches
#2266
Conversation
/cc @kballard do you want to have a look at this? |
Unrelated but consider rebasing onto latest Nix master -- in particular without cb9ef85 this branch fails tests (which means it doesn't build without disabling them, making it harder to test the resulting binaries and makes it less clear that tests would pass "if" they passed on commit this was based on...). Anyway no big deal just thought I'd mention it after running into such failures trying to give this a go :). |
Maybe -A would
Be more consistent with existing tooling?
… On Jul 5, 2018, at 9:40 AM, Will Dietz ***@***.***> wrote:
Unrelated but consider rebasing onto latest Nix master -- in particular without cb9ef85 this branch fails tests (which means it doesn't build without disabling them, making it harder to test the resulting binaries and makes it less clear that tests would pass "if" they passed on commit this was based on...).
Anyway no big deal just thought I'd mention it after running into such failures trying to give this a go :).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
ef0e228
to
cb8e47f
Compare
Consider adding this fix: dtzWill@80d8ca6 To fix reading/writing cache in presence of "No description" packages. |
seems legit, is it okay if I just cherry-pick it onto my branch? |
(of course! Thanks! <3) |
@edolstra any chance to get this merged?:) |
59976bc
to
00e4a78
Compare
rebased onto latest master and resolved conflicts. |
anything missing here? |
@grahamc anything missing or any chance to get this merged? |
This pull request has been mentioned on Nix community. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/9 |
I'm not familiar with the C++ sources but I took a look at this PR and it looks pretty good to me. |
00e4a78
to
aec2933
Compare
Commit message and PR title reference |
RunPager pager; | ||
for (auto el : results) std::cout << el.second << "\n"; | ||
RunPager pager; | ||
for (auto el : results) std::cout << el.second << "\n"; |
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.
Don't we need to run this line when json == true
as well?
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.
After taking another look at the code, it appears the real answer is "when json == true
, results
is always empty".
aec2933
to
db8467f
Compare
-a
for attribute-only searches-A
for attribute-only searches
@edolstra anything missing here to get this merged? :) |
In the end, the attribute paths are most important when it comes to installing a package from any nix-based package set. However `nix search` looks inside values like the description as well for the regex. This canbe quite helpful, but when running e.g. `nix search git`, results like this might be unwanted: ``` * nixpkgs.bspwm-unstable (bspwm-unstable-2016-09-30) A tiling window manager based on binary space partitioning (git version) ``` Closes NixOS#2050
JSON output shouldn't be written into a pager, additionally the "no results" error was thrown by mistake with `--json`. Furthermore replace empty package descriptions with `No description` when `--json` is not set.
Use local variable for adding formatting to 'description' instead of overwriting what is later written to cache. This is more than cosmetic, as these escapes are rejected when trying to read the cache back in.
db8467f
to
b3533ec
Compare
Rebased onto latest master :) |
Will close this now due to inactivity. It has been stated that |
-A
for this purpose (seenix search
should have flag to only search package names #2050)nix search
with--json