COOPY » Guide  version 0.6.5
/home/paulfitz/cvs/coopy_scm/coopy/src/ssmerge/ssresolve.cpp
Go to the documentation of this file.
00001 
00002 #include <stdio.h>
00003 #include <coopy/Options.h>
00004 #include <coopy/Diff.h>
00005 
00006 using namespace std;
00007 using namespace coopy::app;
00008 
00009 int main(int argc, char *argv[]) {
00010   Options opt("ssresolve");
00011   int r = opt.apply(argc,argv);
00012   if (r!=0) return r;
00013 
00014   bool help = opt.checkBool("help");
00015 
00016   const vector<string>& core = opt.getCore();
00017   if (core.size()>1) {
00018     fprintf(stderr, "Options not understood\n");
00019     return 1;
00020   }
00021 
00022   if (core.size()<1||help) {
00023     opt.beginHelp();
00024     opt.addUsage("ssresolve [options] FILE");
00025     opt.addDescription("Resolve a file with conflicts from ssmerge.");
00026     opt.showOptions(OPTION_FOR_RESOLVE);
00027     opt.addExample("ssresolve numbers_muddle.csv",
00028                    "Check if file is resolved.").require("_numbers_muddle.csv");
00029     opt.addExample("ssresolve --ours numbers_muddle.csv",
00030                    "Resolve conflicts in favor of local/left values.").require("_numbers_muddle.csv");
00031     opt.addExample("ssresolve --theirs numbers_muddle.csv",
00032                    "Resolve conflicts in favor of remote/right values.").require("_numbers_muddle.csv");
00033     opt.addExample("ssresolve --neither numbers_muddle.csv",
00034                    "Resolve conflicts in favor of ancestral values.").require("_numbers_muddle.csv");
00035     opt.endHelp();
00036     return help?0:1;
00037   }
00038 
00039   Diff diff;
00040   return diff.apply(opt);
00041 }
00042 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines