Using argv[0] represent binary executable files' name in help() function in sample codes instead of cpp files' name.#16652
Conversation
asmorkalov
left a comment
There was a problem hiding this comment.
Well done! Thanks for contribution! Please take a look on build warnings reported by CI bot and my local remarks.
https://pullrequest.opencv.org/buildbot/builders/precommit_linux64/builds/24986/steps/compile%20release/logs/warnings%20%282%29
samples/cpp/camshiftdemo.cpp
Outdated
| "Usage: \n" | ||
| " ./camshiftdemo [camera number]\n"; | ||
| "Usage: \n\t"; | ||
| cout << argv[0] << "./camshiftdemo [camera number]\n"; |
There was a problem hiding this comment.
Please remove ./camshiftdemo, argv[0] does it for you.
samples/cpp/facedetect.cpp
Outdated
| " [--scale=<image scale greater or equal to 1, try 1.3 for example>]\n" | ||
| " [--try-flip]\n" | ||
| " [filename|camera_index]\n\n" | ||
| "see " << argv[0] << ".cmd for one call:\n" |
There was a problem hiding this comment.
There is no such .cmd file in the repository, please remove it from help message.
samples/cpp/select3dobj.cpp
Outdated
|
|
||
| static string helphelp(char** argv) | ||
| { | ||
| return string("") + |
There was a problem hiding this comment.
You can wrap the first part of message with std::string() and not introduce extra empty line.
There was a problem hiding this comment.
Thinks a lot. I will continue improving these problems.
|
Looks good to me. Could you squash the commits to merge things as single patch. |
I have done a merge operation. Thank you a lot. |
samples/cpp/facedetect.cpp
Outdated
| " [--scale=<image scale greater or equal to 1, try 1.3 for example>]\n" | ||
| " [--try-flip]\n" | ||
| " [filename|camera_index]\n\n" | ||
| "see " << argv[0] << " for one call:\n" |
There was a problem hiding this comment.
The line is redundant. Original help message mentioned facedetect.cmd file, but there is no such file in the repository now. Please, replace "see " << argv[0] << " for one call:\n" with something like "example:\n" and the following command line.
in sample codes instead of cpp files' name.
In some sample files, when display usage, it will use the cpp files' name as binary executable files' name. However, it should be actual file name. So I use the
argv[0]instead of cpp files' name.For example, sample files code as follows.
Now, I update it to:
Pull Request Readiness Checklist
Patch to opencv_extra has the same branch name.