Index: /trunk/include/iprt/getopt.h
===================================================================
--- /trunk/include/iprt/getopt.h	(revision 8146)
+++ /trunk/include/iprt/getopt.h	(revision 8147)
@@ -38,18 +38,42 @@
  */
 
-/** @name RTOPTIONDEF::f
+/** @name RTOPTIONDEF::fFlags
+ *
+ * @remarks When neither of the RTGETOPT_FLAG_HEX, RTGETOPT_FLAG_OCT and RTGETOPT_FLAG_DEC
+ *          flags are specified with a integer value format, RTGetOpt will default to
+ *          decimal but recognize the 0x prefix when present. RTGetOpt will not look for
+ *          for the octal prefix (0).
  * @{ */
-
-/** Requires no extra argument. 
+/** Requires no extra argument.
  * (Can be assumed to be 0 for ever.) */
 #define RTGETOPT_REQ_NOTHING                    0
 /** A value is required or error will be returned. */
 #define RTGETOPT_REQ_STRING                     1
+/** The value must be a valid signed 8-bit integer or an error will be returned. */
+#define RTGETOPT_REQ_INT8                       2
+/** The value must be a valid unsigned 8-bit integer or an error will be returned. */
+#define RTGETOPT_REQ_UINT8                      3
+/** The value must be a valid signed 16-bit integer or an error will be returned. */
+#define RTGETOPT_REQ_INT16                      4
+/** The value must be a valid unsigned 16-bit integer or an error will be returned. */
+#define RTGETOPT_REQ_UINT16                     5
 /** The value must be a valid signed 32-bit integer or an error will be returned. */
-#define RTGETOPT_REQ_INT32                      2
-/** The value must be a valid signed 32-bit integer or an error will be returned. */
-#define RTGETOPT_REQ_UINT32                     3
+#define RTGETOPT_REQ_INT32                      6
+/** The value must be a valid unsigned 32-bit integer or an error will be returned. */
+#define RTGETOPT_REQ_UINT32                     7
+/** The value must be a valid signed 64-bit integer or an error will be returned. */
+#define RTGETOPT_REQ_INT64                      8
+/** The value must be a valid unsigned 64-bit integer or an error will be returned. */
+#define RTGETOPT_REQ_UINT64                     9
 /** The mask of the valid required types. */
-#define RTGETOPT_REQ_MASK                       3
+#define RTGETOPT_REQ_MASK                       15
+/** Treat the value as hexadecimal - only applicable with the RTGETOPT_REQ_*INT*. */
+#define RTGETOPT_FLAG_HEX                       RT_BIT(16)
+/** Treat the value as octal - only applicable with the RTGETOPT_REQ_*INT*. */
+#define RTGETOPT_FLAG_OCT                       RT_BIT(17)
+/** Treat the value as decimal - only applicable with the RTGETOPT_REQ_*INT*. */
+#define RTGETOPT_FLAG_DEC                       RT_BIT(18)
+/** Mask of valid bits - for validation. */
+#define RTGETOPT_VALID_MASK                     ( RTGETOPT_REQ_MASK | RTGETOPT_FLAG_HEX | RTGETOPT_FLAG_OCT | RTGETOPT_FLAG_DEC )
 /** @} */
 
@@ -62,6 +86,6 @@
      * This is optional */
     const char     *pszLong;
-    /** The short option character. 
-     * This doesn't have to be a character, it may also be a \#define or enum value if 
+    /** The short option character.
+     * This doesn't have to be a character, it may also be a \#define or enum value if
      * there isn't any short version of this option. */
     int             iShort;
@@ -76,6 +100,11 @@
 /**
  * Option argument union.
- * 
+ *
  * What ends up here depends on argument format in the option definition.
+ *
+ * @remarks Integers will bet put in the \a i and \a u members and sign/zero extended
+ *          according to the signedness indicated by the \a fFlags. So, you can choose
+ *          use which ever of the integer members for accessing the value regardless
+ *          of restrictions indicated in the \a fFlags.
  */
 typedef union RTOPTIONUNION
@@ -86,11 +115,34 @@
     /** A RTGETOPT_ARG_FORMAT_STRING option argument. */
     const char     *psz;
-    /** A RTGETOPT_ARG_FORMAT_INT32 option argument. */
+
+#if !defined(RT_ARCH_AMD64) && !defined(RT_ARCH_X86)
+# error "PORTME: big-endian systems will need to fix the layout here to get the next two fields working right"
+#endif
+
+    /** A RTGETOPT_ARG_FORMAT_INT8 option argument. */
+    int8_t          i8;
+    /** A RTGETOPT_ARG_FORMAT_UINT8 option argument . */
+    uint8_t         u8;
+    /** A RTGETOPT_ARG_FORMAT_INT16 option argument. */
+    int16_t         i16;
+    /** A RTGETOPT_ARG_FORMAT_UINT16 option argument . */
+    uint16_t        u16;
+    /** A RTGETOPT_ARG_FORMAT_INT16 option argument. */
     int32_t         i32;
     /** A RTGETOPT_ARG_FORMAT_UINT32 option argument . */
     uint32_t        u32;
+    /** A RTGETOPT_ARG_FORMAT_INT64 option argument. */
+    int64_t         i64;
+    /** A RTGETOPT_ARG_FORMAT_UINT64 option argument. */
+    uint64_t        u64;
+    /** A signed integer value. */
+    int64_t         i;
+    /** An unsigned integer value. */
+    uint64_t        u;
 } RTOPTIONUNION;
 /** Pointer to an option argument union. */
 typedef RTOPTIONUNION *PRTOPTIONUNION;
+/** Pointer to a const option argument union. */
+typedef RTOPTIONUNION const *PCRTOPTIONUNION;
 
 
@@ -100,5 +152,5 @@
  *
  * This is to be called in a loop until it returns 0 (meaning that all options
- * were parsed) or a negative value (meaning that an error occured). The passed in 
+ * were parsed) or a negative value (meaning that an error occured). The passed in
  * argument vector is sorted into options and non-option arguments, such that when
  * returning 0 the *piThis is the index of the first non-option argument.
@@ -115,5 +167,5 @@
  * int main(int argc, char *argv[])
  * {
- *      static const RTOPTIONDEF g_aOptions[] = 
+ *      static const RTOPTIONDEF g_aOptions[] =
  *      {
  *          { "--optwithstring",    's', RTGETOPT_REQ_STRING },
@@ -145,10 +197,10 @@
  *          }
  *      }
- *     
+ *
  *      while (i < argc)
  *      {
  *          //do stuff to argv[i].
  *      }
- * 
+ *
  *      return 0;
  * }
@@ -164,5 +216,5 @@
  *                      that require an argument, this contains the value of that argument, depending on the type that is required.
  */
-RTDECL(int) RTGetOpt(int argc, char *argv[], PCRTOPTIONDEF paOptions, size_t cOptions, int *piThis, PRTOPTIONUNION pValueUnion);
+RTDECL(int) RTGetOpt(int argc, char **argv, PCRTOPTIONDEF paOptions, size_t cOptions, int *piThis, PRTOPTIONUNION pValueUnion);
 
 /** @} */
Index: /trunk/src/VBox/Runtime/common/misc/getopt.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/misc/getopt.cpp	(revision 8146)
+++ /trunk/src/VBox/Runtime/common/misc/getopt.cpp	(revision 8147)
@@ -32,9 +32,11 @@
 #include <iprt/string.h>
 #include <iprt/assert.h>
+#include <iprt/ctype.h>
 
 
 
-RTDECL(int) RTGetOpt(int argc, char *argv[], PCRTOPTIONDEF paOptions, size_t cOptions, int *piThis, PRTOPTIONUNION pValueUnion)
+RTDECL(int) RTGetOpt(int argc, char **argv, PCRTOPTIONDEF paOptions, size_t cOptions, int *piThis, PRTOPTIONUNION pValueUnion)
 {
+    pValueUnion->u64 = 0;
     pValueUnion->pDef = NULL;
 
@@ -51,46 +53,119 @@
         for (size_t i = 0; i < cOptions; i++)
         {
-            bool fShort = false;
-            if (    (   paOptions[i].pszLong
-                     && !strcmp(pszArgThis, paOptions[i].pszLong))
-                ||  (   (fShort = (pszArgThis[1] == paOptions[i].iShort))
-                     && pszArgThis[2] == '\0'
-                    )
-               )
+            Assert(!(paOptions[i].fFlags & ~RTGETOPT_VALID_MASK));
+
+            if ((paOptions[i].fFlags & RTGETOPT_REQ_MASK) != RTGETOPT_REQ_NOTHING)
             {
-                Assert(!(paOptions[i].fFlags & ~RTGETOPT_REQ_MASK));
-                pValueUnion->pDef = &paOptions[i];
+                /*
+                 * A value is required with the argument. We're trying to very
+                 * understanding here and will permit any of the following:
+                 *      -svalue, -s:value, -s=value,
+                 *      -s value, -s: value, -s= value
+                 * (Ditto for long options.)
+                 */
+                bool fShort = false;
+                size_t cchLong = 2;
+                if (    (   paOptions[i].pszLong
+                         && !strncmp(pszArgThis, paOptions[i].pszLong, (cchLong = strlen(paOptions[i].pszLong)))
+                         && (   pszArgThis[cchLong] == '\0'
+                             || pszArgThis[cchLong] == ':'
+                             || pszArgThis[cchLong] == '=')
+                        )
+                    ||  (fShort = (pszArgThis[1] == paOptions[i].iShort))
+                   )
+                {
+                    pValueUnion->pDef = &paOptions[i]; /* in case of error. */
 
-                if ((paOptions[i].fFlags & RTGETOPT_REQ_MASK) != RTGETOPT_REQ_NOTHING)
-                {
-                    if (iThis >= argc - 1)
-                        return VERR_GETOPT_REQUIRED_ARGUMENT_MISSING;
+                    /*
+                     * Find the argument value
+                     */
+                    const char *pszValue;
+                    if (    fShort
+                        ?       pszArgThis[2] == '\0'
+                            || ((pszArgThis[2] == ':' || pszArgThis[2] == '=') && pszArgThis[3] == '\0')
+                        :   pszArgThis[cchLong] == '\0' || pszArgThis[cchLong + 1] == '\0')
+                    {
+                        if (iThis + 1 >= argc)
+                            return VERR_GETOPT_REQUIRED_ARGUMENT_MISSING;
+                        pszValue = argv[iThis + 1];
+                        (*piThis)++;
+                    }
+                    else /* same argument. */
+                        pszValue = fShort
+                                 ? &pszArgThis[2  + (pszArgThis[2] == ':' || pszArgThis[2] == '=')]
+                                 : &pszArgThis[cchLong + 1];
 
-                    int iNext = (*piThis)++;
-                    switch (paOptions[i].fFlags & RTGETOPT_REQ_MASK)
+                    /*
+                     * Transform into a option value as requested.
+                     * If decimal conversion fails, we'll check for "0x<xdigit>" and
+                     * try a 16 based conversion. We will not interpret any of the
+                     * generic ints as octals.
+                     */
+                    switch (paOptions[i].fFlags & (RTGETOPT_REQ_MASK | RTGETOPT_FLAG_HEX | RTGETOPT_FLAG_OCT | RTGETOPT_FLAG_DEC))
                     {
                         case RTGETOPT_REQ_STRING:
-                            pValueUnion->psz = argv[iNext];
+                            pValueUnion->psz = pszValue;
                             break;
 
-                        case RTGETOPT_REQ_INT32:
-                        {
-                            int32_t i32;
-                            if (RTStrToInt32Full(argv[iNext], 10, &i32))
-                                return VERR_GETOPT_INVALID_ARGUMENT_FORMAT;
-
-                            pValueUnion->i32 = i32;
-                            break;
+#define MY_INT_CASE(req,type,memb,convfn) \
+                        case req: \
+                        { \
+                            type Value; \
+                            if (    convfn(pszValue, 10, &Value) != VINF_SUCCESS \
+                                &&  (   pszValue[0] != '0' \
+                                     || (pszValue[1] != 'x' && pszValue[1] != 'X') \
+                                     || !RT_C_IS_XDIGIT(pszValue[2]) \
+                                     || convfn(pszValue, 16, &Value) != VINF_SUCCESS ) ) \
+                                return VERR_GETOPT_INVALID_ARGUMENT_FORMAT; \
+                            pValueUnion->memb = Value; \
+                            break; \
+                        }
+#define MY_BASE_INT_CASE(req,type,memb,convfn,base) \
+                        case req: \
+                        { \
+                            type Value; \
+                            if (convfn(pszValue, base, &Value) != VINF_SUCCESS) \
+                                return VERR_GETOPT_INVALID_ARGUMENT_FORMAT; \
+                            pValueUnion->memb = Value; \
+                            break; \
                         }
 
-                        case RTGETOPT_REQ_UINT32:
-                        {
-                            uint32_t u32;
-                            if (RTStrToUInt32Full(argv[iNext], 10, &u32))
-                                return VERR_GETOPT_INVALID_ARGUMENT_FORMAT;
-    
-                            pValueUnion->u32 = u32;
-                            break;
-                        }
+                        MY_INT_CASE(RTGETOPT_REQ_INT8,   int8_t,   i,   RTStrToInt8Full)
+                        MY_INT_CASE(RTGETOPT_REQ_INT16,  int16_t,  i,   RTStrToInt16Full)
+                        MY_INT_CASE(RTGETOPT_REQ_INT32,  int32_t,  i,   RTStrToInt32Full)
+                        MY_INT_CASE(RTGETOPT_REQ_INT64,  int64_t,  i,   RTStrToInt64Full)
+                        MY_INT_CASE(RTGETOPT_REQ_UINT8,  uint8_t,  u,   RTStrToUInt8Full)
+                        MY_INT_CASE(RTGETOPT_REQ_UINT16, uint16_t, u,   RTStrToUInt16Full)
+                        MY_INT_CASE(RTGETOPT_REQ_UINT32, uint32_t, u,   RTStrToUInt32Full)
+                        MY_INT_CASE(RTGETOPT_REQ_UINT64, uint64_t, u,   RTStrToUInt64Full)
+
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT8   | RTGETOPT_FLAG_HEX, int8_t,   i,   RTStrToInt8Full,   16)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT16  | RTGETOPT_FLAG_HEX, int16_t,  i,   RTStrToInt16Full,  16)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT32  | RTGETOPT_FLAG_HEX, int32_t,  i,   RTStrToInt32Full,  16)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT64  | RTGETOPT_FLAG_HEX, int64_t,  i,   RTStrToInt64Full,  16)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT8  | RTGETOPT_FLAG_HEX, uint8_t,  u,   RTStrToUInt8Full,  16)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT16 | RTGETOPT_FLAG_HEX, uint16_t, u,   RTStrToUInt16Full, 16)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_HEX, uint32_t, u,   RTStrToUInt32Full, 16)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT64 | RTGETOPT_FLAG_HEX, uint64_t, u,   RTStrToUInt64Full, 16)
+
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT8   | RTGETOPT_FLAG_DEC, int8_t,   i,   RTStrToInt8Full,   10)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT16  | RTGETOPT_FLAG_DEC, int16_t,  i,   RTStrToInt16Full,  10)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT32  | RTGETOPT_FLAG_DEC, int32_t,  i,   RTStrToInt32Full,  10)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT64  | RTGETOPT_FLAG_DEC, int64_t,  i,   RTStrToInt64Full,  10)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT8  | RTGETOPT_FLAG_DEC, uint8_t,  u,   RTStrToUInt8Full,  10)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT16 | RTGETOPT_FLAG_DEC, uint16_t, u,   RTStrToUInt16Full, 10)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_DEC, uint32_t, u,   RTStrToUInt32Full, 10)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT64 | RTGETOPT_FLAG_DEC, uint64_t, u,   RTStrToUInt64Full, 10)
+
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT8   | RTGETOPT_FLAG_OCT, int8_t,   i,   RTStrToInt8Full,   8)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT16  | RTGETOPT_FLAG_OCT, int16_t,  i,   RTStrToInt16Full,  8)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT32  | RTGETOPT_FLAG_OCT, int32_t,  i,   RTStrToInt32Full,  8)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_INT64  | RTGETOPT_FLAG_OCT, int64_t,  i,   RTStrToInt64Full,  8)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT8  | RTGETOPT_FLAG_OCT, uint8_t,  u,   RTStrToUInt8Full,  8)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT16 | RTGETOPT_FLAG_OCT, uint16_t, u,   RTStrToUInt16Full, 8)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_OCT, uint32_t, u,   RTStrToUInt32Full, 8)
+                        MY_BASE_INT_CASE(RTGETOPT_REQ_UINT64 | RTGETOPT_FLAG_OCT, uint64_t, u,   RTStrToUInt64Full, 8)
+#undef MY_INT_CASE
+#undef MY_BASE_INT_CASE
 
                         default:
@@ -98,6 +173,14 @@
                             return VERR_INTERNAL_ERROR;
                     }
+                    return paOptions[i].iShort;
                 }
-
+            }
+            else if (   (   paOptions[i].pszLong
+                         && !strcmp(pszArgThis, paOptions[i].pszLong))
+                     || (   pszArgThis[1] == paOptions[i].iShort
+                         && pszArgThis[2] == '\0') /** @todo implement support for ls -lsR like stuff?  */
+                    )
+            {
+                pValueUnion->pDef = &paOptions[i];
                 return paOptions[i].iShort;
             }
@@ -105,5 +188,5 @@
     }
 
-    /** @todo Sort options and arguments (i.e. stuff that doesn't start with '-'), stop when 
+    /** @todo Sort options and arguments (i.e. stuff that doesn't start with '-'), stop when
      * encountering the first argument. */
 
Index: /trunk/src/VBox/Runtime/testcase/tstGetOpt.cpp
===================================================================
--- /trunk/src/VBox/Runtime/testcase/tstGetOpt.cpp	(revision 8146)
+++ /trunk/src/VBox/Runtime/testcase/tstGetOpt.cpp	(revision 8147)
@@ -42,9 +42,10 @@
 #define CHECK(expr)  do { if (!(expr)) { RTPrintf("tstGetOpt: error line %d (i=%d): %s\n", __LINE__, i, #expr); cErrors++; } } while (0)
 
-#define CHECK_GETOPT(expr, chRet, iNext) \
+#define CHECK_GETOPT(expr, chRet, iInc) \
     do { \
+        const int iPrev = i; \
         CHECK((expr) == (chRet)); \
-        CHECK(i == (iNext)); \
-        i = (iNext); \
+        CHECK(i == (iInc) + iPrev); \
+        i = (iInc) + iPrev; \
     } while (0)
 
@@ -52,5 +53,5 @@
      * Simple.
      */
-    static const RTOPTIONDEF s_aOpts2[] = 
+    static const RTOPTIONDEF s_aOpts2[] =
     {
         { "--optwithstring",    's', RTGETOPT_REQ_STRING },
@@ -61,10 +62,18 @@
     };
 
-    char *argv2[] = 
+    char *argv2[] =
     {
         "-s",               "string1",
         "--optwithstring",  "string2",
         "-i",               "-42",
+        "-i:-42",
+        "-i=-42",
+        "-i:",              "-42",
+        "-i=",              "-42",
         "--optwithint",     "42",
+        "--optwithint:42",
+        "--optwithint=42",
+        "--optwithint:",    "42",
+        "--optwithint=",    "42",
         "-v",
         "--verbose",
@@ -80,19 +89,40 @@
     CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 's', 2);
     CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "string1"));
-    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 's', 4);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 's', 2);
     CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "string2"));
-    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 6);
+
+    /* -i */
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 2);
     CHECK(Val.i32 == -42);
-    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 8);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 1);
+    CHECK(Val.i32 == -42);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 1);
+    CHECK(Val.i32 == -42);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 2);
+    CHECK(Val.i32 == -42);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 2);
+    CHECK(Val.i32 == -42);
+
+    /* --optwithint */
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 2);
     CHECK(Val.i32 == 42);
-    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'v', 9);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 1);
+    CHECK(Val.i32 == 42);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 1);
+    CHECK(Val.i32 == 42);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 2);
+    CHECK(Val.i32 == 42);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'i', 2);
+    CHECK(Val.i32 == 42);
+
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'v', 1);
     CHECK(Val.pDef == &s_aOpts2[2]);
-    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'v', 10);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'v', 1);
     CHECK(Val.pDef == &s_aOpts2[2]);
-    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'q', 11);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 'q', 1);
     CHECK(Val.pDef == &s_aOpts2[3]);
-    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 384, 12);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 384, 1);
     CHECK(Val.pDef == &s_aOpts2[4]);
-    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 0, 12);
+    CHECK_GETOPT(RTGetOpt(argc2, argv2, &s_aOpts2[0], RT_ELEMENTS(s_aOpts2), &i, &Val), 0, 0);
     CHECK(Val.pDef == NULL);
     CHECK(argc2 == i);
