about summary refs log tree commit diff
path: root/src/libmain
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-09-10T13·32+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-09-10T13·32+0000
commitdcc433de47d4bf4a27fe63bc8996e946164ae885 (patch)
tree0d27a8f0433094144b7cdab591726f2ec288d937 /src/libmain
parentc16be6ac92b86981e8e4bb6703e694b675a28b0d (diff)
* Operation `--delete-generations' to delete generations of a
  profile.  Arguments are either generation number, or `old' to delete
  all non-current generations.  Typical use:

  $ nix-env --delete-generations old
  $ nix-collect-garbage

* istringstream -> string2Int.

Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/shared.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 5affce77ed64..24f6ec4df92b 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -155,10 +155,8 @@ static void initAndRun(int argc, char * * argv)
         else if (arg == "--max-jobs" || arg == "-j") {
             ++i;
             if (i == args.end()) throw UsageError("`--max-jobs' requires an argument");
-            istringstream str(*i);
             int n;
-            str >> n;
-            if (!str || !str.eof() || n < 0)
+            if (!string2Int(*i, n) || n < 0)
                 throw UsageError(format("`--max-jobs' requires a non-negative integer"));
             maxBuildJobs = n;
         }