mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
* Help text for all (non-script) programs, so no more:
$ nix-instantiate --help error: unknown flag `--help` Try `nix-instantiate --help' for more information. :-)
This commit is contained in:
parent
905d5b91fa
commit
078e20885e
14 changed files with 126 additions and 32 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "shared.hh"
|
||||
#include "parser.hh"
|
||||
#include "eval.hh"
|
||||
#include "help.txt.hh"
|
||||
|
||||
|
||||
typedef void (* Operation) (EvalState & state,
|
||||
|
@ -20,6 +21,12 @@ struct DrvInfo
|
|||
typedef map<Path, DrvInfo> DrvInfos;
|
||||
|
||||
|
||||
void printHelp()
|
||||
{
|
||||
cout << string((char *) helpText, sizeof helpText);
|
||||
}
|
||||
|
||||
|
||||
bool parseDerivation(EvalState & state, Expr e, DrvInfo & drv)
|
||||
{
|
||||
ATMatcher m;
|
||||
|
@ -395,10 +402,6 @@ void run(Strings args)
|
|||
op = opUninstall;
|
||||
else if (arg == "--query" || arg == "-q")
|
||||
op = opQuery;
|
||||
else if (arg == "--verbose" || arg == "-v")
|
||||
verbosity = (Verbosity) ((int) verbosity + 1);
|
||||
else if (arg[0] == '-')
|
||||
opFlags.push_back(arg);
|
||||
else
|
||||
opArgs.push_back(arg);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue