getopt.cpp revision d618bed3882cd227cf8f5d0d2824f8db42fad415
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync/* $Id$ */
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync/** @file
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync * innotek Portable Runtime - Command Line Parsing
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync */
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync/*
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync * Copyright (C) 2007 innotek GmbH
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync *
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * available from http://www.virtualbox.org. This file is free software;
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * you can redistribute it and/or modify it under the terms of the GNU
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * General Public License (GPL) as published by the Free Software
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync *
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * The contents of this file may alternatively be used under the terms
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * of the Common Development and Distribution License Version 1.0
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * VirtualBox OSE distribution, in which case the provisions of the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * CDDL are applicable instead of those of the GPL.
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync *
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * You may elect to license modified versions of this file under the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * terms and conditions of either the GPL or the CDDL or both.
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync */
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync/*******************************************************************************
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync* Header Files *
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync*******************************************************************************/
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync#include <iprt/getopt.h>
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync#include <iprt/err.h>
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync#include <iprt/string.h>
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync#include <iprt/assert.h>
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync#include <iprt/ctype.h>
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsyncRTDECL(int) RTGetOpt(int argc, char **argv, PCRTOPTIONDEF paOptions, size_t cOptions, int *piThis, PRTOPTIONUNION pValueUnion)
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync{
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync pValueUnion->u64 = 0;
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync pValueUnion->pDef = NULL;
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync if ( !piThis
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync || *piThis >= argc
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync )
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync return 0;
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync int iThis = (*piThis)++;
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync const char *pszArgThis = argv[iThis];
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync if (*pszArgThis == '-')
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync {
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync for (size_t i = 0; i < cOptions; i++)
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync {
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync Assert(!(paOptions[i].fFlags & ~RTGETOPT_VALID_MASK));
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync if ((paOptions[i].fFlags & RTGETOPT_REQ_MASK) != RTGETOPT_REQ_NOTHING)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync {
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync /*
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync * A value is required with the argument. We're trying to very
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync * understanding here and will permit any of the following:
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync * -svalue, -s:value, -s=value,
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync * -s value, -s: value, -s= value
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync * (Ditto for long options.)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync */
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync bool fShort = false;
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync size_t cchLong = 2;
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync if ( ( paOptions[i].pszLong
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync && !strncmp(pszArgThis, paOptions[i].pszLong, (cchLong = strlen(paOptions[i].pszLong)))
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync && ( pszArgThis[cchLong] == '\0'
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync || pszArgThis[cchLong] == ':'
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync || pszArgThis[cchLong] == '=')
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync )
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync || (fShort = (pszArgThis[1] == paOptions[i].iShort))
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync )
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync {
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync pValueUnion->pDef = &paOptions[i]; /* in case of error. */
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync /*
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync * Find the argument value
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync */
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync const char *pszValue;
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync if ( fShort
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync ? pszArgThis[2] == '\0'
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync || ((pszArgThis[2] == ':' || pszArgThis[2] == '=') && pszArgThis[3] == '\0')
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync : pszArgThis[cchLong] == '\0' || pszArgThis[cchLong + 1] == '\0')
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync {
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync if (iThis + 1 >= argc)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync return VERR_GETOPT_REQUIRED_ARGUMENT_MISSING;
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync pszValue = argv[iThis + 1];
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync (*piThis)++;
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync }
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync else /* same argument. */
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync pszValue = fShort
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync ? &pszArgThis[2 + (pszArgThis[2] == ':' || pszArgThis[2] == '=')]
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync : &pszArgThis[cchLong + 1];
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync /*
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync * Transform into a option value as requested.
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync * If decimal conversion fails, we'll check for "0x<xdigit>" and
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync * try a 16 based conversion. We will not interpret any of the
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync * generic ints as octals.
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync */
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync switch (paOptions[i].fFlags & (RTGETOPT_REQ_MASK | RTGETOPT_FLAG_HEX | RTGETOPT_FLAG_OCT | RTGETOPT_FLAG_DEC))
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync {
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync case RTGETOPT_REQ_STRING:
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync pValueUnion->psz = pszValue;
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync break;
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync#define MY_INT_CASE(req,type,memb,convfn) \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync case req: \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync { \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync type Value; \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync if ( convfn(pszValue, 10, &Value) != VINF_SUCCESS \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync && ( pszValue[0] != '0' \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync || (pszValue[1] != 'x' && pszValue[1] != 'X') \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync || !RT_C_IS_XDIGIT(pszValue[2]) \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync || convfn(pszValue, 16, &Value) != VINF_SUCCESS ) ) \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync return VERR_GETOPT_INVALID_ARGUMENT_FORMAT; \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync pValueUnion->memb = Value; \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync break; \
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync }
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync#define MY_BASE_INT_CASE(req,type,memb,convfn,base) \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync case req: \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync { \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync type Value; \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync if (convfn(pszValue, base, &Value) != VINF_SUCCESS) \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync return VERR_GETOPT_INVALID_ARGUMENT_FORMAT; \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync pValueUnion->memb = Value; \
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync break; \
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync }
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_INT_CASE(RTGETOPT_REQ_INT8, int8_t, i, RTStrToInt8Full)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_INT_CASE(RTGETOPT_REQ_INT16, int16_t, i, RTStrToInt16Full)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_INT_CASE(RTGETOPT_REQ_INT32, int32_t, i, RTStrToInt32Full)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_INT_CASE(RTGETOPT_REQ_INT64, int64_t, i, RTStrToInt64Full)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_INT_CASE(RTGETOPT_REQ_UINT8, uint8_t, u, RTStrToUInt8Full)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_INT_CASE(RTGETOPT_REQ_UINT16, uint16_t, u, RTStrToUInt16Full)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_INT_CASE(RTGETOPT_REQ_UINT32, uint32_t, u, RTStrToUInt32Full)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_INT_CASE(RTGETOPT_REQ_UINT64, uint64_t, u, RTStrToUInt64Full)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT8 | RTGETOPT_FLAG_HEX, int8_t, i, RTStrToInt8Full, 16)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT16 | RTGETOPT_FLAG_HEX, int16_t, i, RTStrToInt16Full, 16)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT32 | RTGETOPT_FLAG_HEX, int32_t, i, RTStrToInt32Full, 16)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT64 | RTGETOPT_FLAG_HEX, int64_t, i, RTStrToInt64Full, 16)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT8 | RTGETOPT_FLAG_HEX, uint8_t, u, RTStrToUInt8Full, 16)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT16 | RTGETOPT_FLAG_HEX, uint16_t, u, RTStrToUInt16Full, 16)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_HEX, uint32_t, u, RTStrToUInt32Full, 16)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT64 | RTGETOPT_FLAG_HEX, uint64_t, u, RTStrToUInt64Full, 16)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT8 | RTGETOPT_FLAG_DEC, int8_t, i, RTStrToInt8Full, 10)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT16 | RTGETOPT_FLAG_DEC, int16_t, i, RTStrToInt16Full, 10)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT32 | RTGETOPT_FLAG_DEC, int32_t, i, RTStrToInt32Full, 10)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT64 | RTGETOPT_FLAG_DEC, int64_t, i, RTStrToInt64Full, 10)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT8 | RTGETOPT_FLAG_DEC, uint8_t, u, RTStrToUInt8Full, 10)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT16 | RTGETOPT_FLAG_DEC, uint16_t, u, RTStrToUInt16Full, 10)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_DEC, uint32_t, u, RTStrToUInt32Full, 10)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT64 | RTGETOPT_FLAG_DEC, uint64_t, u, RTStrToUInt64Full, 10)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT8 | RTGETOPT_FLAG_OCT, int8_t, i, RTStrToInt8Full, 8)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT16 | RTGETOPT_FLAG_OCT, int16_t, i, RTStrToInt16Full, 8)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT32 | RTGETOPT_FLAG_OCT, int32_t, i, RTStrToInt32Full, 8)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_INT64 | RTGETOPT_FLAG_OCT, int64_t, i, RTStrToInt64Full, 8)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT8 | RTGETOPT_FLAG_OCT, uint8_t, u, RTStrToUInt8Full, 8)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT16 | RTGETOPT_FLAG_OCT, uint16_t, u, RTStrToUInt16Full, 8)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_OCT, uint32_t, u, RTStrToUInt32Full, 8)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync MY_BASE_INT_CASE(RTGETOPT_REQ_UINT64 | RTGETOPT_FLAG_OCT, uint64_t, u, RTStrToUInt64Full, 8)
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync#undef MY_INT_CASE
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync#undef MY_BASE_INT_CASE
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync default:
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync AssertMsgFailed(("i=%d f=%#x\n", i, paOptions[i].fFlags));
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync return VERR_INTERNAL_ERROR;
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync }
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync return paOptions[i].iShort;
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync }
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync }
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync else if ( ( paOptions[i].pszLong
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync && !strcmp(pszArgThis, paOptions[i].pszLong))
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync || ( pszArgThis[1] == paOptions[i].iShort
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync && pszArgThis[2] == '\0') /** @todo implement support for ls -lsR like stuff? */
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync )
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync {
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync pValueUnion->pDef = &paOptions[i];
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync return paOptions[i].iShort;
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync }
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync }
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync }
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync /** @todo Sort options and arguments (i.e. stuff that doesn't start with '-'), stop when
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync * encountering the first argument. */
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync return VERR_GETOPT_UNKNOWN_OPTION;
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync}
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync