changeset 83:c17475848bf4

Allow for paths to be specified on commandline.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Thu, 10 Oct 2013 14:13:54 +0200
parents f507a7240bc9
children 848496a57039
files Apps/updateDeDupe.cpp
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Apps/updateDeDupe.cpp	Thu Oct 10 14:13:01 2013 +0200
+++ b/Apps/updateDeDupe.cpp	Thu Oct 10 14:13:54 2013 +0200
@@ -3,11 +3,28 @@
 #include "Exception/Exception.hpp"
 
 #include <iostream>
+#include <QtCore/QList>
+#include <boost/foreach.hpp>
 
 int main(int argc, char *argv[]) {
 
+  QStringList paths;
+
+  for (int i = 1; i < argc; ++i) {
+    char path_buf[PATH_MAX];
+    realpath(argv[i], path_buf);
+    paths.push_back(path_buf);
+  }
+
   try {
-    DataController dc(false);
+    if (paths.empty()) {
+      DataController dc(false);
+    }
+    else {
+      foreach(const QString& path, paths) {
+	DataController dc(path, false);
+      }
+    }
   }
   catch (Exception& e) {
     std::cerr << "Unrecoverable error: " << e.toString().toStdString();