1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-04 15:31:47 +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:
Eelco Dolstra 2012-10-03 16:37:06 -04:00
parent 9c41c66c5b
commit a562d544d8
25 changed files with 51 additions and 329 deletions

View file

@ -1,13 +1,8 @@
bin_PROGRAMS = nix-hash
nix_hash_SOURCES = nix-hash.cc help.txt
nix_hash_SOURCES = nix-hash.cc
nix_hash_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \
../boost/format/libformat.la
nix-hash.o: help.txt.hh
%.txt.hh: %.txt
../bin2c/bin2c helpText < $< > $@ || (rm $@ && exit 1)
AM_CXXFLAGS = \
-I$(srcdir)/.. -I$(srcdir)/../libutil -I$(srcdir)/../libstore -I$(srcdir)/../libmain

View file

@ -1,9 +0,0 @@
Usage: nix-hash [OPTIONS...] [FILES...]
`nix-hash' computes and prints cryptographic hashes for the specified
files.
--flat: compute hash of regular file contents, not metadata
--base32: print hash in base-32 instead of hexadecimal
--type HASH: use hash algorithm HASH ("md5" (default), "sha1", "sha256")
--truncate: truncate the hash to 160 bits

View file

@ -1,6 +1,5 @@
#include "hash.hh"
#include "shared.hh"
#include "help.txt.hh"
#include <iostream>
@ -10,7 +9,7 @@ using namespace nix;
void printHelp()
{
std::cout << string((char *) helpText);
showManPage("nix-hash");
}