about summary refs log tree commit diff
path: root/src/nix-env/main.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-02-06T16·16+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-02-06T16·16+0000
commitb8675aee5470c5387e4bfe4906e4ab1e94b610b2 (patch)
treee77860fa961a07f9303d31c977253873a98d031a /src/nix-env/main.cc
parent73ab2ed4fd1c3cd974851be4f13e7a276ab16acf (diff)
* In `--list-generations', show what the current generation is.
Diffstat (limited to 'src/nix-env/main.cc')
-rw-r--r--src/nix-env/main.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc
index 6aa342c1daff..5ef61bb306a0 100644
--- a/src/nix-env/main.cc
+++ b/src/nix-env/main.cc
@@ -480,15 +480,17 @@ static void opListGenerations(Globals & globals,
     if (opArgs.size() != 0)
         throw UsageError(format("no arguments expected"));
 
-    Generations gens = findGenerations(globals.profile);
+    int curGen;
+    Generations gens = findGenerations(globals.profile, curGen);
 
     for (Generations::iterator i = gens.begin(); i != gens.end(); ++i) {
         tm t;
         if (!localtime_r(&i->creationTime, &t)) throw Error("cannot convert time");
-        cout << format("%|4|   %|4|-%|02|-%|02| %|02|:%|02|:%|02|\n")
+        cout << format("%|4|   %|4|-%|02|-%|02| %|02|:%|02|:%|02|   %||\n")
             % i->number
             % (t.tm_year + 1900) % (t.tm_mon + 1) % t.tm_mday
-            % t.tm_hour % t.tm_min % t.tm_sec;
+            % t.tm_hour % t.tm_min % t.tm_sec
+            % (i->number == curGen ? "(current)" : "");
     }
 }