From 24e23a1a73d573c5d0cda86c34e0e1fd5aef9171 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 7 Sep 2017 20:42:11 +0200 Subject: [PATCH] nix search: Add examples --- src/nix/search.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/nix/search.cc b/src/nix/search.cc index 6e099ce37..9476b79fb 100644 --- a/src/nix/search.cc +++ b/src/nix/search.cc @@ -56,6 +56,24 @@ struct CmdSearch : SourceExprCommand, MixJSON 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) override { settings.readOnlyMode = true;