about summary refs log tree commit diff
path: root/src/nix-env/nix-env.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-23T12·19+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-23T12·38+0200
commit887bb5fa5a5a7b8b91d371de1a5c8280f9505744 (patch)
tree2486f49317aded421a8a33d692960651fff8a437 /src/nix-env/nix-env.cc
parent1993b10d1169b04b83443a9ef5d4e3e38667afeb (diff)
--version: Print some config info
Such as whether Nix is built with signed binary cache support, and the
location of the configuration file.
Diffstat (limited to 'src/nix-env/nix-env.cc')
-rw-r--r--src/nix-env/nix-env.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index c5c7d2ccc713..04f1016167a9 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -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_))