about summary refs log tree commit diff
path: root/scripts/nix-build.in
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-03T20·37-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-03T20·40-0400
commita562d544d8520a0f113ad1a348e28ea00f27b693 (patch)
tree5e8d7200b8521aa54e2c8846ef7c31fd5dac737e /scripts/nix-build.in
parent9c41c66c5b877dbb529f6147b28384a57a591895 (diff)
When ‘--help’ is given, just run ‘man’ to show the manual page
I.e. do what git does.  I'm too lazy to keep the builtin help text up
to date :-)

Also add ‘--help’ to various commands that lacked it
(e.g. nix-collect-garbage).
Diffstat (limited to 'scripts/nix-build.in')
-rwxr-xr-xscripts/nix-build.in26
1 files changed, 2 insertions, 24 deletions
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index 8973f5fb7316..427bc605b562 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -33,36 +33,14 @@ for (my $n = 0; $n < scalar @ARGV; $n++) {
     my $arg = $ARGV[$n];
 
     if ($arg eq "--help") {
-        print STDERR <<EOF;
-Usage: nix-build [OPTION]... [FILE]...
-
-`nix-build' builds the given Nix expressions (which
-default to ./default.nix if none are given).  A symlink called
-`result' is placed in the current directory.
-
-Flags:
-  --add-drv-link: create a symlink `derivation' to the store derivation
-  --drv-link NAME: create symlink NAME instead of `derivation'
-  --no-out-link: do not create the `result' symlink
-  --out-link / -o NAME: create symlink NAME instead of `result'
-  --attr / -A ATTR: select a specific attribute from the Nix expression
-
-  --run-env: build dependencies of the specified derivation, then start a
-      shell with the environment of the derivation
-  --command: command to run with `--run-env'
-  --exclude: regexp specifying dependencies to be excluded by `--run-env'
-
-Any additional flags are passed to `nix-store'.
-EOF
-        exit 0;
-        # '` hack
+        exec "man nix-build" or die;
     }
 
     elsif ($arg eq "--version") {
         print "nix-build (Nix) $Nix::Config::version\n";
         exit 0;
     }
-    
+
     elsif ($arg eq "--add-drv-link") {
         $drvLink = "./derivation";
     }