#include "auto_ptr.h"
+#include "snapper/Factory.h"
#include "snapper/Snapper.h"
#include "snapper/Exception.h"
Snapper*
- createSnapper(const string& config_name)
+ createSnapper(const string& config_name, bool disable_filters)
{
if (the_one.get())
throw LogicErrorException();
- the_one.reset(new Snapper(config_name));
+ the_one.reset(new Snapper(config_name, disable_filters));
return the_one.get();
}
using namespace std;
- Snapper::Snapper(const string& config_name)
+ Snapper::Snapper(const string& config_name, bool disable_filters)
: config_name(config_name), config(NULL), subvolume("/"), snapshots(this),
compare_callback(NULL), rollback_callback(NULL)
{
y2mil("Snapper constructor");
y2mil("libsnapper version " VERSION);
- y2mil("config_name:" << config_name);
+ y2mil("config_name:" << config_name << " disable_filters:" << disable_filters);
try
{
y2mil("subvolume:" << subvolume);
- loadIgnorePatterns();
+ if (!disable_filters)
+ loadIgnorePatterns();
snapshots.initialize();
}
bool quiet = false;
bool verbose = false;
string config_name = "root";
+bool disable_filters = false;
Snapper* sh = NULL;
<< _("\t--verbose, -v\t\t\tIncrease verbosity.") << endl
<< _("\t--table-style, -t <style>\tTable style (integer).") << endl
<< _("\t--config, -c <name>\t\tSet name of config to use.") << endl
+ << _("\t--disable-filters\t\tDisable filters.") << endl
<< _("\t--version\t\t\tPrint version and exit.") << endl
<< endl;
{ "verbose", no_argument, 0, 'v' },
{ "table-style", required_argument, 0, 't' },
{ "config", required_argument, 0, 'c' },
+ { "disable-filters", no_argument, 0, 0 },
{ "version", no_argument, 0, 0 },
{ 0, 0, 0, 0 }
};
if ((opt = opts.find("config")) != opts.end())
config_name = opt->second;
+ if ((opt = opts.find("disable-filters")) != opts.end())
+ disable_filters = true;
+
if ((opt = opts.find("version")) != opts.end())
{
cout << "snapper " << VERSION << endl;
{
try
{
- sh = createSnapper(config_name);
+ sh = createSnapper(config_name, disable_filters);
}
catch (const ConfigNotFoundException& e)
{