{
if (argc < 2) {
usage();
- return -1;
+ return 1;
}
sglog().setLogLevels(SG_ALL, SG_ALERT);
int numfiles = 0;
- string out;
+ string outfile;
SGPropertyNode root;
for (int i = 1; i < argc; i++) {
if (s == "-o" || s == "--output") {
if (i + 1 == argc)
break;
- out = argv[++i];
+ outfile = argv[++i];
continue;
}
numfiles++;
} catch (const sg_exception &e) {
cerr << "Error: " << e.getFormattedMessage() << endl;
- return -2;
+ return 2;
}
}
if (!numfiles) {
cerr << "Error: Nothing to merge." << endl;
- return -3;
+ return 3;
}
try {
- if (out.empty())
+ if (outfile.empty())
writeProperties(cout, &root, true);
else
- writeProperties(out, &root, true);
+ writeProperties(outfile, &root, true);
} catch (const sg_exception &e) {
cerr << "Error: " << e.getFormattedMessage() << endl;
- return -4;
+ return 4;
}
return 0;