about summary refs log tree commit diff
path: root/src/libmain/shared.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmain/shared.cc')
-rw-r--r--src/libmain/shared.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index e91ef2667824..32f4f81240bb 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -70,6 +70,9 @@ static void initAndRun(int argc, char * * argv)
         else if (arg == "--help") {
             printHelp();
             return;
+        } else if (arg == "--version") {
+            cout << format("%1% (Nix) %2%") % programId % NIX_VERSION << endl;
+            return;
         } else if (arg == "--keep-failed" || arg == "-K")
             keepFailed = true;
         else remaining.push_back(arg);