Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

parser.has() alway retruning true

$
0
0
Hello, I´m trying to use CommandLineParser and I have a problem : even if I don´t put anything when I lauch the program (only ./prog ), the function parser.has returns true, as if something was given on the command line. If someone has an idea of what I am doing wrong, it would be very helpful ! Thanks :) Here is the code : const char* keys = { "{help | | show help message }" "{type | | type of the camera}" "{camera_number | | camera number }" }; int main(int argc, char* argv[]) { CommandLineParser parser(argc, argv, keys); bool t = parser.has("type"); cout << " t = " << t << endl; bool cm = parser.has("camera_number"); cout << "cm = " << cm << endl; return 0; }

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>