view Apps/updateDeDupe.cpp @ 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 dd086ec3220d
children 5906661c0421
line wrap: on
line source

#include "DataController.hpp"

#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 {
    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();
    exit(1);
  }

}