Skip to content

Commit

Permalink
Added -h option
Browse files Browse the repository at this point in the history
  • Loading branch information
fgiaimo committed Jul 29, 2015
1 parent b931e5f commit 16dd75d
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions CaroloCup-CameraPlayback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,18 @@ void setLabel(Mat& img, const string label, const Point& anchor)

void errorMessage(string name)
{
cerr << "Wrong command line parameters supplied." << endl
<< "Usage :\t" << name << " [-l] myRecording.rec [myRecording.csv]" << endl
<< "Options :" << endl << " -l \t\t\t Enables logging on standard output" << endl;
cerr << "Wrong command line parameters supplied." << endl;
cerr << "Usage :\t" << name << " -h" << endl
<< "\t" << name << " [-l] myRecording.rec [myRecording.csv]" << endl
<< "Options :" << endl << " -l \t\t\t Enables logging to standard output" << endl;
}

void helpMessage(string name)
{
cerr << "Usage :\t" << name << " -h" << endl
<< "\t" << name << " [-l] myRecording.rec [myRecording.csv]" << endl
<< "Options :" << endl << " -h \t\t\t Show this help" << endl
<< " -l \t\t\t Enables logging to standard output" << endl;
}

int32_t main(int32_t argc, char **argv)
Expand All @@ -107,6 +116,11 @@ int32_t main(int32_t argc, char **argv)
errorMessage(string(argv[0]));
retVal = 1;
}
else if(argc==2 && string(argv[1]).compare("-h")==0)
{
helpMessage(string(argv[0]));
retVal = 0;
}
else
{
// if -l option is set
Expand Down

0 comments on commit 16dd75d

Please sign in to comment.