From 078e20885e0805e04669f9b334a516a6d8d12763 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 1 Dec 2003 15:55:05 +0000 Subject: * Help text for all (non-script) programs, so no more: $ nix-instantiate --help error: unknown flag `--help` Try `nix-instantiate --help' for more information. :-) --- src/nix-env/main.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/nix-env/main.cc') diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc index 3c72a7950727..829e2f4ae508 100644 --- a/src/nix-env/main.cc +++ b/src/nix-env/main.cc @@ -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 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); -- cgit 1.4.1