VirtualBox

Ignore:
Timestamp:
Feb 14, 2010 9:39:00 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57688
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstTSC.cpp

    r25000 r26517  
    420420        { "--duration",         'd', RTGETOPT_REQ_UINT32 },
    421421        { "--calc-frequency",   'f', RTGETOPT_REQ_NOTHING },
    422         { "--help",             'h', RTGETOPT_REQ_NOTHING }
    423422    };
    424423    int iArg = 1;
     
    430429        switch (ch)
    431430        {
    432             case 'd':   cMsDuration = Value.u32; break;
    433             case 'f':   fCalcFrequency = true; break;
     431            case 'd':   cMsDuration = Value.u32;
     432                break;
     433
     434            case 'f':   fCalcFrequency = true;
     435                break;
     436
    434437            case 'h':
    435438                RTPrintf("usage: tstTSC\n"
     
    437440                return 1;
    438441
    439             case VINF_GETOPT_NOT_OPTION:
    440                 RTStrmPrintf(g_pStdErr, "tstTSC: too many arguments\n");
    441                 break;
     442            case 'V':
     443                RTPrintf("$Revision: $\n");
     444                return 0;
    442445
    443446            default:
    444                 RTStrmPrintf(g_pStdErr, "tstTSC: Unknown arg or error (ch=%d)\n", ch);
    445                 return 1;
     447                return RTGetOptPrintError(ch, &Value);
    446448        }
    447449
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