2021-01-26 15:36:22 +00:00
|
|
|
#include <args.hpp>
|
2021-01-26 16:21:06 +00:00
|
|
|
#include <config.hpp>
|
2021-01-26 15:36:22 +00:00
|
|
|
|
|
|
|
const char* argp_program_version =
|
2021-03-23 16:01:37 +00:00
|
|
|
PROJECT_NAME " " VERSION_CODE "\n\n"
|
2021-01-26 15:36:22 +00:00
|
|
|
"License: GPLv3 <https://www.gnu.org/licenses/gpl-3.0.html>\n"
|
|
|
|
"If you did not receive a copy of the source code, it is\n"
|
2021-03-23 16:01:37 +00:00
|
|
|
"available at <git://git.epicalert.xyz/facecam2d.git> or the\n"
|
|
|
|
"GitLab mirror at <https://gitlab.com/epicalert/facecam2d.git>.";
|
2021-01-26 15:36:22 +00:00
|
|
|
|
|
|
|
const struct argp_option options[] = {
|
|
|
|
//name, key, arg, flags, doc, group
|
2021-02-06 04:12:37 +00:00
|
|
|
{"haar-cascade", 0x00, 0, 0, "Use Haar Cascades for faster (but less accurate) face detection.", 0},
|
|
|
|
{"model", 'm', "model", 0, "Name of the model file to use. (not including '.fma')", 0},
|
2021-01-26 15:36:22 +00:00
|
|
|
{0}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct argp argp = {
|
|
|
|
options,
|
|
|
|
parseOptions,
|
|
|
|
0,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
struct optData optData = {
|
2021-02-06 04:12:37 +00:00
|
|
|
false,
|
|
|
|
"test",
|
2021-01-26 15:36:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
error_t parseOptions(int key, char* arg, struct argp_state* state) {
|
|
|
|
switch (key) {
|
|
|
|
case 0x00: //--haar-cascade
|
|
|
|
optData.useHaar = true;
|
|
|
|
break;
|
|
|
|
|
2021-02-06 04:12:37 +00:00
|
|
|
case 'm':
|
|
|
|
optData.model = std::string(arg);
|
|
|
|
break;
|
|
|
|
|
2021-01-26 15:36:22 +00:00
|
|
|
default:
|
|
|
|
return ARGP_ERR_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|