about summary refs log tree commit diff
path: root/src/nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-09-07T18·18+0200
committerEelco Dolstra <edolstra@gmail.com>2017-09-07T18·18+0200
commit2ebeffcfd46f4a471cf4e49130ec106cf8a88ff1 (patch)
tree131852aece36525b853586fcee934974d76b298a /src/nix
parent17afc42895a586d6eefa76583c55022261b0d923 (diff)
nix log: Add examples
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/log.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/nix/log.cc b/src/nix/log.cc
index 15ae61d08ccb..966ad8b65087 100644
--- a/src/nix/log.cc
+++ b/src/nix/log.cc
@@ -19,7 +19,25 @@ struct CmdLog : InstallableCommand
 
     std::string description() override
     {
-        return "show the build log of the specified packages or paths";
+        return "show the build log of the specified packages or paths, if available";
+    }
+
+    Examples examples() override
+    {
+        return {
+            Example{
+                "To get the build log of GNU Hello:",
+                "nix log nixpkgs.hello"
+            },
+            Example{
+                "To get the build log of a specific path:",
+                "nix log /nix/store/lmngj4wcm9rkv3w4dfhzhcyij3195hiq-thunderbird-52.2.1"
+            },
+            Example{
+                "To get a build log from a specific binary cache:",
+                "nix log --store https://cache.nixos.org nixpkgs.hello"
+            },
+        };
     }
 
     void run(ref<Store> store) override