1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

--version: Print some config info

Such as whether Nix is built with signed binary cache support, and the
location of the configuration file.
This commit is contained in:
Eelco Dolstra 2015-07-23 14:19:49 +02:00
parent 1993b10d11
commit 887bb5fa5a
3 changed files with 28 additions and 2 deletions

View file

@ -1027,6 +1027,12 @@ static void opGenerateBinaryCacheKey(Strings opFlags, Strings opArgs)
}
static void opVersion(Strings opFlags, Strings opArgs)
{
printVersion("nix-store");
}
/* Scan the arguments; find the operation, set global flags, put all
other flags in a list, and put all other arguments in another
list. */
@ -1044,7 +1050,7 @@ int main(int argc, char * * argv)
if (*arg == "--help")
showManPage("nix-store");
else if (*arg == "--version")
printVersion("nix-store");
op = opVersion;
else if (*arg == "--realise" || *arg == "--realize" || *arg == "-r")
op = opRealise;
else if (*arg == "--add" || *arg == "-A")