Disable command line args on Windows

It seems argp doesn't work on Windows, so we can disable it for now.
This commit is contained in:
Epicalert 2021-06-10 01:38:03 +08:00
parent 16a7ff8ee1
commit 735e27ac53
No known key found for this signature in database
GPG key ID: CAA46F858D0979BD
3 changed files with 9 additions and 0 deletions

View file

@ -8,6 +8,7 @@ const char* argp_program_version =
"available at <git://git.epicalert.xyz/facecam2d.git> or the\n" "available at <git://git.epicalert.xyz/facecam2d.git> or the\n"
"GitLab mirror at <https://gitlab.com/epicalert/facecam2d.git>."; "GitLab mirror at <https://gitlab.com/epicalert/facecam2d.git>.";
#ifndef _WIN64
const struct argp_option options[] = { const struct argp_option options[] = {
//name, key, arg, flags, doc, group //name, key, arg, flags, doc, group
{"haar-cascade", 0x00, 0, 0, "Use Haar Cascades for faster (but less accurate) face detection.", 0}, {"haar-cascade", 0x00, 0, 0, "Use Haar Cascades for faster (but less accurate) face detection.", 0},
@ -21,12 +22,14 @@ struct argp argp = {
0, 0,
0 0
}; };
#endif
struct optData optData = { struct optData optData = {
false, false,
"test", "test",
}; };
#ifndef _WIN64
error_t parseOptions(int key, char* arg, struct argp_state* state) { error_t parseOptions(int key, char* arg, struct argp_state* state) {
switch (key) { switch (key) {
case 0x00: //--haar-cascade case 0x00: //--haar-cascade
@ -43,3 +46,4 @@ error_t parseOptions(int key, char* arg, struct argp_state* state) {
return 0; return 0;
} }
#endif

View file

@ -2,9 +2,12 @@
#define ARGS_HPP #define ARGS_HPP
#include <string> #include <string>
#ifndef _WIN64
#include <argp.h> #include <argp.h>
error_t parseOptions(int key, char* arg, struct argp_state* state); error_t parseOptions(int key, char* arg, struct argp_state* state);
#endif
struct optData { struct optData {
bool useHaar; //use haar cascades (0x00) bool useHaar; //use haar cascades (0x00)

View file

@ -9,7 +9,9 @@
#include <cstring> #include <cstring>
int main (int argc, char** argv) { int main (int argc, char** argv) {
#ifndef _WIN64
argp_parse(&argp, argc, argv, 0, 0, 0); argp_parse(&argp, argc, argv, 0, 0, 0);
#endif
std::cout << PROJECT_NAME " is starting..." << std::endl; std::cout << PROJECT_NAME " is starting..." << std::endl;