fftest.cc 781 B

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