From 4c9ff89c261d84dcc4f88a79654daff2f4790e66 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 25 Jul 2017 15:09:06 +0200 Subject: nix-build/nix-shell: Eliminate call to nix-instantiate / nix-store Note that this removes the need for a derivation symlink, so the --drv-path and --add-drv-link flags now do nothing. --- src/libmain/shared.cc | 9 ++++++++- src/libmain/shared.hh | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/libmain') diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 915e79550144..48b00e1a399a 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -222,7 +222,14 @@ struct LegacyArgs : public MixCommonArgs void parseCmdLine(int argc, char * * argv, std::function parseArg) { - LegacyArgs(baseNameOf(argv[0]), parseArg).parseCmdline(argvToStrings(argc, argv)); + parseCmdLine(baseNameOf(argv[0]), argvToStrings(argc, argv), parseArg); +} + + +void parseCmdLine(const string & programName, const Strings & args, + std::function parseArg) +{ + LegacyArgs(programName, parseArg).parseCmdline(args); } diff --git a/src/libmain/shared.hh b/src/libmain/shared.hh index 6d94a22f788e..14e436cc8bb2 100644 --- a/src/libmain/shared.hh +++ b/src/libmain/shared.hh @@ -25,6 +25,9 @@ void initNix(); void parseCmdLine(int argc, char * * argv, std::function parseArg); +void parseCmdLine(const string & programName, const Strings & args, + std::function parseArg); + void printVersion(const string & programName); /* Ugh. No better place to put this. */ -- cgit 1.4.1