Added the usage report to the examples for when no arguments are passed

to the examples.
This commit is contained in:
Robert Osfield
2003-04-06 21:32:44 +00:00
parent 908164d58a
commit 49a28660dc
40 changed files with 166 additions and 72 deletions

View File

@@ -14,7 +14,7 @@ ArgumentParser::ArgumentParser(int* argc,char **argv):
{
}
std::string ArgumentParser::getProgramName() const
std::string ArgumentParser::getApplicationName() const
{
if (_argc>0) return std::string(_argv[0]);
return "";
@@ -314,7 +314,7 @@ void ArgumentParser::reportRemainingOptionsAsUnrecognized(ErrorSeverity severity
// if an option and havn't been previous querried for report as unrecognized.
if (isOption(pos) && options.find(_argv[pos])==options.end())
{
reportError(getProgramName() +": unrceognized option "+_argv[pos],severity);
reportError(getApplicationName() +": unrceognized option "+_argv[pos],severity);
}
}
}
@@ -326,7 +326,7 @@ void ArgumentParser::writeErrorMessages(std::ostream& output,ErrorSeverity sever
{
if (itr->second>=severity)
{
output<< getProgramName() << ": " << itr->first << std::endl;
output<< getApplicationName() << ": " << itr->first << std::endl;
}
}
}