about summary refs log tree commit diff
path: root/scripts/nix-copy-closure.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-copy-closure.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-copy-closure.in')
-rwxr-xr-xscripts/nix-copy-closure.in11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/nix-copy-closure.in b/scripts/nix-copy-closure.in
index 12a83cff979c..0eb7a4ed0c16 100755
--- a/scripts/nix-copy-closure.in
+++ b/scripts/nix-copy-closure.in
@@ -37,8 +37,11 @@ my @storePaths = ();
 
 while (@ARGV) {
     my $arg = shift @ARGV;
-    
-    if ($arg eq "--sign") {
+
+    if ($arg eq "--help") {
+        exec "man nix-copy-closure" or die;
+    }
+    elsif ($arg eq "--sign") {
         $sign = 1;
     }
     elsif ($arg eq "--gzip") {
@@ -92,7 +95,7 @@ else { # Copy FROM the remote machine.
     my $extraOpts = $includeOutputs ? "--include-outputs" : "";
     my $pid = open(READ,
         "set -f; ssh @sshOpts $sshHost nix-store --query --requisites $extraOpts @storePaths|") or die;
-    
+
     while (<READ>) {
         chomp;
         die "bad: $_" unless /^\//;
@@ -106,7 +109,7 @@ else { # Copy FROM the remote machine.
         print STDERR "copying ", scalar @missing, " missing paths from ‘$sshHost’...\n";
         $compressor = "| $compressor" if $compressor ne "";
         $decompressor = "$decompressor |" if $decompressor ne "";
-	$progressViewer = "$progressViewer |" if $progressViewer ne "";
+        $progressViewer = "$progressViewer |" if $progressViewer ne "";
         unless ($dryRun) {
             my $extraOpts = $sign ? "--sign" : "";
             system("set -f; ssh $sshHost @sshOpts 'nix-store --export $extraOpts @missing $compressor' | $progressViewer $decompressor $Nix::Config::binDir/nix-store --import > /dev/null") == 0