nix: Respect -I, --arg, --argstr

Also, random cleanup to argument handling.
This commit is contained in:
Eelco Dolstra 2017-10-24 12:45:11 +02:00
parent 25f32625e2
commit 0d59f1ca49
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
26 changed files with 349 additions and 299 deletions

View file

@ -1,10 +1,12 @@
#pragma once
#include "args.hh"
#include "common-eval-args.hh"
namespace nix {
struct Value;
struct Bindings;
class EvalState;
/* A command is an argument parser that can be executed by calling its
@ -68,14 +70,11 @@ struct Installable
}
};
struct SourceExprCommand : virtual Args, StoreCommand
struct SourceExprCommand : virtual Args, StoreCommand, MixEvalArgs
{
Path file;
SourceExprCommand()
{
mkFlag('f', "file", "file", "evaluate FILE rather than the default", &file);
}
SourceExprCommand();
/* Return a value representing the Nix expression from which we
are installing. This is either the file specified by --file,
@ -111,7 +110,7 @@ struct InstallablesCommand : virtual Args, SourceExprCommand
private:
Strings _installables;
std::vector<std::string> _installables;
};
struct InstallableCommand : virtual Args, SourceExprCommand