]> git.decadent.org.uk Git - dak.git/blob - tools/dsync-0.0/test/fftest.cc
Merge mainline
[dak.git] / tools / dsync-0.0 / test / fftest.cc
1 #include <dsync/cmndline.h>
2 #include <dsync/error.h>
3 #include <dsync/filefilter.h>
4
5 int main(int argc, const char *argv[])
6 {
7    CommandLine::Args Args[] = {
8       {'i',"include","filter:: + ",CommandLine::HasArg},
9       {'e',"exclude","filter:: - ",CommandLine::HasArg},
10       {'c',"config-file",0,CommandLine::ConfigFile},
11       {'o',"option",0,CommandLine::ArbItem},
12       {0,0,0,0}};
13    CommandLine CmdL(Args,_config);
14    if (CmdL.Parse(argc,argv) == false)
15    {
16       _error->DumpErrors();
17       return 100;
18    }
19    
20    _config->Dump();
21    
22    dsFileFilter Filt;
23    if (Filt.LoadFilter(_config->Tree("filter")) == false)
24    {
25       _error->DumpErrors();
26       return 100;
27    }
28
29    cout << "Test: " << Filt.Test(CmdL.FileList[0],CmdL.FileList[1]) << endl;
30       
31    return 0;
32 }