MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/diff/main.cpp:214–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214int main(int argc, char* argv[])
215{
216 int ch;
217 acl::string new_file, old_file;
218 DIFF_RES res;
219
220 res.deleted = -1;
221 res.updated = -1;
222 res.added = -1;
223 res.equal = -1;
224
225 while ((ch = getopt(argc, argv, "hn:o:N:U:D:E:")) > 0)
226 {
227 switch (ch)
228 {
229 case 'h':
230 usage(argv[0]);
231 return 0;
232 case 'n':
233 new_file = optarg;
234 break;
235 case 'o':
236 old_file = optarg;
237 break;
238 case 'N':
239 res.added = atoi(optarg);
240 break;
241 case 'U':
242 res.updated = atoi(optarg);
243 break;
244 case 'D':
245 res.deleted = atoi(optarg);
246 break;
247 case 'E':
248 res.equal = atoi(optarg);
249 break;
250 default:
251 break;
252 }
253 }
254
255 if (new_file.empty() || old_file.empty())
256 {
257 usage(argv[0]);
258 return -1;
259 }
260
261 // 如果设置了完整的期望结果集数值,则传入校验差集结果
262
263 if (check_diff(new_file, old_file,
264 res.updated >= 0 && res.deleted >= 0
265 && res.added >= 0 && res.equal >= 0 ? &res : NULL) == true)
266 {
267 printf("check diff ok, new_file: %s, old_file: %s\r\n",
268 new_file.c_str(), old_file.c_str());
269 }
270 else
271 {

Callers

nothing calls this directly

Calls 5

check_diffFunction · 0.85
usageFunction · 0.70
getoptFunction · 0.50
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…