VirtualBox

Changeset 26517 in vbox for trunk/src/VBox/Devices/Network


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.

Location:
trunk/src/VBox/Devices/Network/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp

    r20864 r26517  
    684684        { "--xmit-test",    'x', RTGETOPT_REQ_NOTHING },
    685685        { "--ping-test",    'P', RTGETOPT_REQ_NOTHING },
    686         { "--help",         'h', RTGETOPT_REQ_NOTHING },
    687         { "--?",            '?', RTGETOPT_REQ_NOTHING },
    688686    };
    689687
     
    805803                break;
    806804
    807             case '?':
    808805            case 'h':
    809806                RTPrintf("syntax: tstIntNet-1 <options>\n"
     
    818815                return 1;
    819816
    820             case VINF_GETOPT_NOT_OPTION:
    821                 RTPrintf("tstIntNetR0: invalid argument: %s\n", Value.psz);
    822                 return 1;
     817            case 'V':
     818                RTPrintf("$Revision$\n");
     819                return 0;
    823820
    824821            default:
    825                 if (RT_SUCCESS(ch))
    826                     RTPrintf("tstIntNetR0: invalid argument (%#x): %s\n", ch, Value.psz);
    827                 else if (Value.pDef)
    828                     RTPrintf("tstIntNetR0: invalid argument: %Rrc - %s\n", ch, Value.pDef->pszLong);
    829                 else
    830                     RTPrintf("tstIntNetR0: invalid argument: %Rrc - %s\n", ch, argv[iArg]);
    831                 return 1;
     822                return RTGetOptPrintError(ch, &Value);
    832823        }
    833824
  • trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp

    r26296 r26517  
    412412    RTGETOPTUNION Value;
    413413    RTGETOPTSTATE GetState;
    414     RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, 0 /* fFlags */);
     414    RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, RTGETOPTINIT_FLAGS_NO_STD_OPTS);
    415415    while ((ch = RTGetOpt(&GetState, &Value)))
    416416        switch (ch)
     
    424424                break;
    425425
    426             case VINF_GETOPT_NOT_OPTION:
    427                 RTPrintf("tstIntNetR0: invalid argument: %s\n", Value.psz);
    428                 return 1;
    429 
    430426            default:
    431                 RTPrintf("tstIntNetR0: invalid argument: %s\n", Value.psz);
    432                 return 1;
     427                return RTGetOptPrintError(ch, &Value);
    433428        }
    434429
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