nix search: Add examples

This commit is contained in:
Eelco Dolstra 2017-09-07 20:42:11 +02:00
parent 4967f0509a
commit 24e23a1a73

View file

@ -56,6 +56,24 @@ struct CmdSearch : SourceExprCommand, MixJSON
return "query available packages"; return "query available packages";
} }
Examples examples() override
{
return {
Example{
"To show all available packages:",
"nix search"
},
Example{
"To show any packages containing 'blender' in its name or description:",
"nix search blender"
},
Example{
"To search for Firefox and Chromium:",
"nix search 'firefox|chromium'"
},
};
}
void run(ref<Store> store) override void run(ref<Store> store) override
{ {
settings.readOnlyMode = true; settings.readOnlyMode = true;