positive error return values, variable name change
This commit is contained in:
parent
b4d6485cfc
commit
7fb8c28ac6
1 changed files with 8 additions and 8 deletions
|
@ -18,13 +18,13 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
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++) {
|
||||
|
@ -37,7 +37,7 @@ int main(int argc, char *argv[])
|
|||
if (s == "-o" || s == "--output") {
|
||||
if (i + 1 == argc)
|
||||
break;
|
||||
out = argv[++i];
|
||||
outfile = argv[++i];
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -46,24 +46,24 @@ int main(int argc, char *argv[])
|
|||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue