1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +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

@ -1282,6 +1282,12 @@ static void opDeleteGenerations(Globals & globals, Strings opFlags, Strings opAr
}
static void opVersion(Globals & globals, Strings opFlags, Strings opArgs)
{
printVersion("nix-env");
}
int main(int argc, char * * argv)
{
return handleExceptions(argv[0], [&]() {
@ -1311,7 +1317,7 @@ int main(int argc, char * * argv)
if (*arg == "--help")
showManPage("nix-env");
else if (*arg == "--version")
printVersion("nix-env");
op = opVersion;
else if (*arg == "--install" || *arg == "-i")
op = opInstall;
else if (parseAutoArgs(arg, end, autoArgs_))