aboutsummaryrefslogtreecommitdiff
path: root/src/nix/search.cc
AgeCommit message (Collapse)Author
2019-10-10Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-10-09nix search: Don't quietly ignore errorsEelco Dolstra
2019-10-07nix search: remove verbose exampleSam Doshi
2019-06-18Make subcommand construction in MultiCommand lazyEelco Dolstra
2019-04-08nix: Make -f work for compatibilityEelco Dolstra
2018-07-27search: include versionWill Dietz
2018-07-02search.cc: improve UX for `nix search`Maximilian Bosch
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-18Allow multiple search experssions in nix searchDaniel Poelzleithner
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-13Merge pull request #1906 from dtzWill/fix/nix-searchShea Levy
nix search: tests and fix #1893 and part of #1892
2018-02-25nix search: explicitly handle empty search string, fixes #1893Will Dietz
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-25nix search: fix bug where we wrote to cache when shouldn't, breakingWill Dietz
This is exposed by the tests added previously, and resolves the error reported in #1892: "expected JSON value".
2017-12-12search.cc: sort attribute names with `std::map`Maximilian Bosch
2017-12-04Fix #1635.Eelco Dolstra
2017-11-14Don't indent JSON outputEelco Dolstra
2017-10-24nix: Respect -I, --arg, --argstrEelco Dolstra
Also, random cleanup to argument handling.
2017-09-07nix search: Add examplesEelco Dolstra
2017-08-29nix search: Warn about cached resultsEelco Dolstra
2017-07-30Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-26nix search: Add a cacheEelco Dolstra
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-20nix search: Ignore top-level eval errorsEelco Dolstra
$NIX_PATH may contain elements that don't evaluate to an attrset (like "nixos-config"), so ignore those.
2017-07-20nix search: Add --json flagEelco Dolstra
2017-07-20Add "nix search" commandEelco Dolstra