]> git.saurik.com Git - cycript.git/commitdiff
Use apr_getopt_long instead of simply apr_getopt.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 29 Jan 2014 16:58:15 +0000 (08:58 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 29 Jan 2014 16:58:15 +0000 (08:58 -0800)
Console.cpp

index d91e6d4766c9c20d2caea7f690c2ca3b57caeb4d..f904f083f5dfea32606c2b3d11ad9dcc9a42c85f 100644 (file)
@@ -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: