about summary refs log tree commit diff
path: root/src/libmain
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-02-02T10·51+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-02-02T10·51+0000
commitd9f30fe7c74ae8518a575c0d15ee00aa46a2229a (patch)
tree14919393077b5cac95a3f76d78364cf38b4c05ba /src/libmain
parent47c003cb5999344aa2e4cb9f912551e33a94cd41 (diff)
* Sort `nix-env -q' output by derivation name.
* `--version' flag for all commands.
* Manual updates.

Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/Makefile.am1
-rw-r--r--src/libmain/shared.cc3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/libmain/Makefile.am b/src/libmain/Makefile.am
index a4969ff36777..6d70b0406acc 100644
--- a/src/libmain/Makefile.am
+++ b/src/libmain/Makefile.am
@@ -7,4 +7,5 @@ AM_CXXFLAGS = \
  -DNIX_DATA_DIR=\"$(datadir)\" \
  -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
  -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \
+ -DNIX_VERSION=\"$(VERSION)\" \
  -I.. -I../../externals/inst/include -I../libutil -I../libstore
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);