about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-01-16T21·06+0100
committerEelco Dolstra <edolstra@gmail.com>2017-01-16T21·11+0100
commit40dfac968a87c1d90b5b3c9e3ffe72a370165047 (patch)
tree3f8b4000632e0695ea5e4c199c250afc7f14a748
parent451c223deea17918454ae083dcfc0ea2b6103cab (diff)
nix-build: Use showManPage() and printVersion()
-rwxr-xr-xsrc/nix-build/nix-build.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc
index 71ef5af86af9..2bb12c9b278f 100755
--- a/src/nix-build/nix-build.cc
+++ b/src/nix-build/nix-build.cc
@@ -136,15 +136,11 @@ int main(int argc, char ** argv)
 
             if (arg == "--help") {
                 deletePath(tmpDir);
-                tmpDir.cancel();
-                execlp("man", "man", myName, NULL);
-                throw SysError("executing man");
+                showManPage(myName);
             }
 
-            else if (arg == "--version") {
-                std::cout << myName << " (Nix) " << nixVersion << '\n';
-                return;
-            }
+            else if (arg == "--version")
+                printVersion(myName);
 
             else if (arg == "--add-drv-link") {
                 drvLink = "./derivation";