Commit 135b9280 authored by Andrey Morozov's avatar Andrey Morozov

improved print help in CommandLineParser

parent 0e18f066
#include "precomp.hpp" #include "precomp.hpp"
#include <iostream> #include <iostream>
#include <iomanip>
using namespace std; using namespace std;
using namespace cv; using namespace cv;
...@@ -257,29 +258,27 @@ template<typename _Tp> ...@@ -257,29 +258,27 @@ template<typename _Tp>
{ {
std::map<std::string, std::vector<std::string> >::iterator it; std::map<std::string, std::vector<std::string> >::iterator it;
std::vector<string> keysVector; std::vector<string> keysVector;
std::string buf;
for(it = data.begin(); it != data.end(); it++) for(it = data.begin(); it != data.end(); it++)
{ {
keysVector = split_string(it->first, "|"); keysVector = split_string(it->first, "|");
for (int i = 0; i < keysVector.size(); i++) keysVector[i] = del_space(keysVector[i]); for (int i = 0; i < keysVector.size(); i++) keysVector[i] = del_space(keysVector[i]);
while (keysVector.size() < 4) keysVector.push_back(""); cout << " ";
cout << "\t";
if (keysVector[0] != "") if (keysVector[0] != "")
{ {
cout << "-" << keysVector[0]; buf = "-" + keysVector[0];
if (keysVector[1] != "") cout << ", --" << keysVector[0]; if (keysVector[1] != "") buf += ", --" + keysVector[1];
} }
else if (keysVector[1] != "") buf += "--" + keysVector[1];
if (del_space(it->second[0]) != "") buf += "=[" + del_space(it->second[0]) + "]";
if (keysVector[1] != "") cout << "--" << keysVector[1]; cout << setw(28) << left << buf;
if (it->second.size() != 0) buf = "";
{ if (del_space(it->second[1]) != "") buf += del_space(it->second[1]);
if (del_space(it->second[0]) != "") cout << " (" << del_space(it->second[0]) << " - by default)";
if (del_space(it->second[1]) != "") cout << " - " << del_space(it->second[1]);
}
cout << endl; cout << setw(50) << left << buf << endl;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment