about summary refs log tree commit diff
path: root/src/nix/search.cc
AgeCommit message (Collapse)AuthorFilesLines
2018-07-02 search.cc: improve UX for `nix search`Maximilian Bosch1-10/+20
As proposed in #1634 the `nix search` command could use some improvements. Initially 0413aeb35d6ee869a98b6565781c1cf47dc80080 added some basic sorting behavior using `std::map`, a next step would be an improvement of the output. This patch includes the following changes: * Use `$PAGER` for outputs with `RunPager` from `shared.hh`: The same behavior is defined for `nix-env --query`, furthermore it makes searching huge results way easier. * Simplified result blocks: The new output is heavily inspired by the output from `nox`, the first line shows the attribute path and the derivaiton name (`attribute path (derivation name)`) and the description in the second line.
2018-04-18 Allow multiple search experssions in nix searchDaniel Poelzleithner1-18/+38
The common use case is to search for packages containing multiple words like a "git" "frontend". Having only one expressions makes this simple regular use case very complicated. Instead, search accepts multiple regular epressions which all need to match. nix search git 'gui|frontend' returns a list of all git uis for example
2018-03-13 Merge pull request #1906 from dtzWill/fix/nix-searchShea Levy1-1/+6
nix search: tests and fix #1893 and part of #1892
2018-02-25 nix search: explicitly handle empty search string, fixes #1893Will Dietz1-0/+5
This is important since this is given as an example. Other patterns containing "empty search string" will still be handled differently on different platforms ("asdf|") but that's less of an issue.
2018-02-25 nix search: fix bug where we wrote to cache when shouldn't, breakingWill Dietz1-1/+1
This is exposed by the tests added previously, and resolves the error reported in #1892: "expected JSON value".
2017-12-12 search.cc: sort attribute names with `std::map`Maximilian Bosch1-6/+6
2017-12-04 Fix #1635.Eelco Dolstra1-3/+18
2017-11-14 Don't indent JSON outputEelco Dolstra1-1/+1
2017-10-24 nix: Respect -I, --arg, --argstrEelco Dolstra1-2/+2
Also, random cleanup to argument handling.
2017-09-07 nix search: Add examplesEelco Dolstra1-0/+18
2017-08-29 nix search: Warn about cached resultsEelco Dolstra1-0/+2
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-4/+4
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-26 nix search: Add a cacheEelco Dolstra1-9/+69
The package list is now cached in ~/.cache/nix/package-search.json. This gives a substantial speedup to "nix search" queries. For example (on an SSD): First run: (no package search cache, cold page cache) $ time nix search blender Attribute name: nixpkgs.blender Package name: blender Version: 2.78c Description: 3D Creation/Animation/Publishing System real 0m6.516s Second run: (package search cache populated) $ time nix search blender Attribute name: nixpkgs.blender Package name: blender Version: 2.78c Description: 3D Creation/Animation/Publishing System real 0m0.143s
2017-07-20 nix search: Ignore top-level eval errorsEelco Dolstra1-1/+8
$NIX_PATH may contain elements that don't evaluate to an attrset (like "nixos-config"), so ignore those.
2017-07-20 nix search: Add --json flagEelco Dolstra1-13/+27
2017-07-20 Add "nix search" commandEelco Dolstra1-0/+130