mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
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).
This commit is contained in:
parent
9c41c66c5b
commit
a562d544d8
25 changed files with 51 additions and 329 deletions
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue