mirror of
https://github.com/NixOS/nix
synced 2025-07-03 06:11:46 +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
|
@ -1,17 +1,12 @@
|
|||
bin_PROGRAMS = nix-store
|
||||
|
||||
nix_store_SOURCES = \
|
||||
nix-store.cc dotgraph.cc dotgraph.hh help.txt \
|
||||
nix_store_SOURCES = \
|
||||
nix-store.cc dotgraph.cc dotgraph.hh \
|
||||
xmlgraph.cc xmlgraph.hh
|
||||
|
||||
nix_store_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \
|
||||
../boost/format/libformat.la -lbz2
|
||||
|
||||
nix-store.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
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
Usage: nix-store [OPTIONS...] [ARGUMENTS...]
|
||||
|
||||
`nix-store' is a tool to manipulate the Nix store.
|
||||
|
||||
Operations:
|
||||
|
||||
--realise / -r: ensure path validity; if a derivation, ensure the
|
||||
validity of the outputs
|
||||
--add / -A: copy a path to the Nix store
|
||||
--delete: safely delete paths from the Nix store
|
||||
--query / -q: query information
|
||||
--read-log / -l: print build log of given store paths
|
||||
|
||||
--register-validity: register path validity (dangerous!)
|
||||
--check-validity: check path validity
|
||||
|
||||
--gc: run the garbage collector
|
||||
|
||||
--dump: dump a path as a Nix archive (NAR), forgetting dependencies
|
||||
--restore: restore a path from a Nix archive, without
|
||||
registering validity
|
||||
|
||||
--export: export a path as a Nix archive, marking dependencies
|
||||
--import: import a path from a Nix archive, and register as
|
||||
valid
|
||||
|
||||
--verify: verify Nix structures
|
||||
--verify-path: verify whether the given store paths haven't been modified
|
||||
--optimise: optimise the Nix store by hard-linking identical files
|
||||
|
||||
--query-failed-paths: list paths that failed to build (if enabled)
|
||||
--clear-failed-paths: clear the failed status of the given paths
|
||||
|
||||
--version: output version information
|
||||
--help: display help
|
||||
|
||||
Query flags:
|
||||
|
||||
--outputs: query the output paths of a Nix derivation (default)
|
||||
--requisites / -R: print all paths necessary to realise the path
|
||||
--references: print all paths referenced by the path
|
||||
--referrers: print all paths directly refering to the path
|
||||
--referrers-closure: print all paths (in)directly refering to the path
|
||||
--tree: print a tree showing the dependency graph of the path
|
||||
--graph: print a dot graph rooted at given path
|
||||
--xml: emit an XML representation of the graph rooted at the given path
|
||||
--hash: print the SHA-256 hash of the contents of the path
|
||||
--size: print the size of the NAR dump of the path
|
||||
--roots: print the garbage collector roots that point to the path
|
||||
|
||||
Query switches (not applicable to all queries):
|
||||
|
||||
--use-output: perform query on output of derivation, not derivation itself
|
||||
--force-realise: realise the path before performing the query
|
||||
--include-outputs: in `-R' on a derivation, include requisites of outputs
|
||||
|
||||
Garbage collector options:
|
||||
|
||||
--print-roots: print GC roots and exit
|
||||
--print-live: print live paths and exit
|
||||
--print-dead: print dead paths and exit
|
||||
--delete: delete dead paths (default)
|
||||
|
||||
Options:
|
||||
|
||||
--verbose / -v: verbose operation (may be repeated)
|
||||
--keep-failed / -K: keep temporary directories of failed builds
|
||||
--keep-going / -k: build as many dependencies as possible, even if
|
||||
some dependencies fail to build
|
||||
|
||||
--add-root: add garbage collector roots for the result
|
|
@ -6,7 +6,6 @@
|
|||
#include "xmlgraph.hh"
|
||||
#include "local-store.hh"
|
||||
#include "util.hh"
|
||||
#include "help.txt.hh"
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
@ -29,7 +28,7 @@ typedef void (* Operation) (Strings opFlags, Strings opArgs);
|
|||
|
||||
void printHelp()
|
||||
{
|
||||
cout << string((char *) helpText);
|
||||
showManPage("nix-store");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue