From: Jay Freeman (saurik) Date: Wed, 29 Jan 2014 16:58:15 +0000 (-0800) Subject: Use apr_getopt_long instead of simply apr_getopt. X-Git-Tag: v0.9.502~31 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/63e43c8b19f0d8e475a3ec5cf63a03170de6b63a Use apr_getopt_long instead of simply apr_getopt. --- diff --git a/Console.cpp b/Console.cpp index d91e6d4..f904f08 100644 --- a/Console.cpp +++ b/Console.cpp @@ -631,17 +631,19 @@ int Main(int argc, char const * const argv[], char const * const envp[]) { _aprcall(apr_getopt_init(&state, pool, argc, argv)); for (;;) { - char opt; + int opt; const char *arg; - apr_status_t status(apr_getopt(state, - "cg:n:" + apr_status_t status(apr_getopt_long(state, (apr_getopt_option_t[]) { + {NULL, 'c', false, NULL}, + {NULL, 'g', true, NULL}, + {NULL, 'n', true, NULL}, #ifdef CY_ATTACH - "p:" + {NULL, 'p', true, NULL}, #endif - "r:" - "s" - , &opt, &arg)); + {NULL, 'r', true, NULL}, + {NULL, 's', false, NULL}, + {0, 0, 0, 0}}, &opt, &arg)); switch (status) { case APR_EOF: