tools: normalize nfdc exit codes

refs #3749

Change-Id: I0c81dff095c170390f62de82badc0cca7b53392d
This commit is contained in:
Junxiao Shi committed 2016-09-14 03:57:57 +00:00
1 parent 737c43cdad
commit bf6acd5cc9
4 files changed
+20 -4

No files matched your search

+9
View File
@@ -47,6 +47,15 @@ If no options are provided, all information is retrieved.
If -x is provided, other options(-v, -c, etc.) are ignored, and all information is printed in XML format.
Exit Codes
----------
0: Success
1: An unspecified error occurred
2: Malformed command line
Examples
--------
+7
View File
@@ -181,7 +181,14 @@ Options
Note that when ``faceId`` is the last Face associated with ``prefix`` FIB entry,
the whole FIB entry will be removed.
Exit Codes
----------
0: Success
1: An unspecified error occurred
2: Malformed command line
Examples
--------
+3 -3
View File
@@ -357,7 +357,7 @@ legacyNfdcMain(ExecuteContext& ctx)
catch (const po::error& e) {
std::cerr << e.what() << std::endl;
legacyNfdcUsage();
return 1;
return 2;
}
if (wantUnsetChildInherit) {
@@ -378,14 +378,14 @@ legacyNfdcMain(ExecuteContext& ctx)
[] (const std::string& s) { return s.empty() || s[0] == '-'; })) {
// unrecognized -option
legacyNfdcUsage();
return 1;
return 2;
}
p.m_commandLineArguments = unparsed;
bool isOk = p.dispatch(subcommand);
if (!isOk) {
legacyNfdcUsage();
return 1;
return 2;
}
ctx.face.processEvents();
return 0;
+1 -1
View File
@@ -56,7 +56,7 @@ main(int argc, char** argv)
}
catch (const std::invalid_argument& e) {
std::cerr << e.what() << std::endl;
return 1;
return 2;
}
try {