diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-10-03T20·37-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-10-03T20·40-0400 |
commit | a562d544d8520a0f113ad1a348e28ea00f27b693 (patch) | |
tree | 5e8d7200b8521aa54e2c8846ef7c31fd5dac737e /scripts/nix-push.in | |
parent | 9c41c66c5b877dbb529f6147b28384a57a591895 (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-push.in')
-rwxr-xr-x | scripts/nix-push.in | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/scripts/nix-push.in b/scripts/nix-push.in index 00d03c3c1f0c..993b94adf064 100755 --- a/scripts/nix-push.in +++ b/scripts/nix-push.in @@ -24,22 +24,11 @@ my $writeManifest = 0; my $archivesURL; my @roots; -sub showSyntax { - print STDERR <<EOF -Usage: nix-push --dest DIR [--manifest] [--url-prefix URL] PATHS... - -`nix-push' packs the closure of PATHS into a set of NAR files stored -in DIR. Optionally generate a manifest. -EOF - ; # ` - exit 1; -} - for (my $n = 0; $n < scalar @ARGV; $n++) { my $arg = $ARGV[$n]; if ($arg eq "--help") { - showSyntax; + exec "man nix-push" or die; } elsif ($arg eq "--bzip2") { $compressionType = "bzip2"; } elsif ($arg eq "--force") { @@ -56,13 +45,13 @@ for (my $n = 0; $n < scalar @ARGV; $n++) { die "$0: `$arg' requires an argument\n" unless $n < scalar @ARGV; $archivesURL = $ARGV[$n]; } elsif (substr($arg, 0, 1) eq "-") { - showSyntax; + die "$0: unknown flag `$arg'\n"; } else { push @roots, $arg; } } -showSyntax if !defined $destDir; +die "$0: please specify a destination directory\n" if !defined $destDir; $archivesURL = "file://$destDir" unless defined $archivesURL; |