VirtualBox

Changeset 26517 in vbox for trunk/src/VBox/Disassembler


Ignore:
Timestamp:
Feb 14, 2010 9:39:00 PM (15 years ago)
Author:
vboxsync
Message:

*: RTGetOpt cleanup related to --help and --version (now standard option). Use RTGetOptPrintError.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Disassembler/testcase/tstDisasm-2.cpp

    r24011 r26517  
    823823        { "--address",      'a', RTGETOPT_REQ_UINT64 },
    824824        { "--cpumode",      'c', RTGETOPT_REQ_UINT32 },
    825         { "--help",         'h', RTGETOPT_REQ_NOTHING },
    826825        { "--bytes",        'b', RTGETOPT_REQ_INT64 },
    827826        { "--listing",      'l', RTGETOPT_REQ_NOTHING },
     
    836835    RTGETOPTUNION ValueUnion;
    837836    RTGETOPTSTATE GetState;
    838     RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, 0 /* fFlags */);
    839     while ((ch = RTGetOpt(&GetState, &ValueUnion)))
     837    RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, RTGETOPTINIT_FLAGS_OPTS_FIRST);
     838    while (   (ch = RTGetOpt(&GetState, &ValueUnion))
     839           && ch != VINF_GETOPT_NOT_OPTION)
    840840    {
    841841        switch (ch)
     
    914914                break;
    915915
    916             case VINF_GETOPT_NOT_OPTION:
    917                 break;
     916            case 'V':
     917                RTPrintf("$Revision: $\n");
     918                return 0;
    918919
    919920            default:
    920                 RTStrmPrintf(g_pStdErr, "%s: syntax error: %Rrc\n", argv0, ch);
    921                 return 1;
     921                return RTGetOptPrintError(ch, &ValueUnion);
    922922        }
    923923    }
Note: See TracChangeset for help on using the changeset viewer.

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