VirtualBox

Ignore:
Timestamp:
Oct 2, 2014 11:34:37 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
96364
Message:

VBoxManage: disable short options to "debugvm ... log" so that log
specificacations like "-drv_nat.l2" don't send it into infinite loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp

    r46658 r52927  
    168168    RTGETOPTUNION               ValueUnion;
    169169
    170     /** @todo Put short options into enum / defines! */
     170    /*
     171     * NB: don't use short options to prevent log specifications like
     172     * "-drv_foo" from being interpreted as options.
     173     */
     174#   define DEBUGVM_LOG_DEBUG       (VINF_GETOPT_NOT_OPTION + 'd')
     175#   define DEBUGVM_LOG_RELEASE     (VINF_GETOPT_NOT_OPTION + 'r')
     176
    171177    static const RTGETOPTDEF    s_aOptions[] =
    172178    {
    173         { "--debug",        'd', RTGETOPT_REQ_NOTHING },
    174         { "--release",      'r', RTGETOPT_REQ_NOTHING }
     179        { "--debug",        DEBUGVM_LOG_DEBUG,  RTGETOPT_REQ_NOTHING },
     180        { "--release",      DEBUGVM_LOG_RELEASE, RTGETOPT_REQ_NOTHING }
    175181    };
    176182    int rc = RTGetOptInit(&GetState, pArgs->argc, pArgs->argv, s_aOptions, RT_ELEMENTS(s_aOptions), 2, RTGETOPTINIT_FLAGS_OPTS_FIRST);
     
    181187        switch (rc)
    182188        {
    183             case 'r':
     189            case DEBUGVM_LOG_RELEASE:
    184190                fRelease = true;
    185191                break;
    186192
    187             case 'd':
     193            case DEBUGVM_LOG_DEBUG:
    188194                fRelease = false;
    189195                break;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette