VirtualBox

Changeset 26485 in vbox for trunk/include


Ignore:
Timestamp:
Feb 14, 2010 6:59:06 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57654
Message:

iprt/getopt: Added two standard options: h: --help/-help/-h/-?, V: --version,-version,-V. These can be disabled by giving using RTGETOPTINIT_FLAGS_NO_STD_OPTS. Added another init flag, RTGETOPTINIT_FLAGS_OPTS_FIRST, for making RTGetOpt return options first and then non-options. Converted tstGetOpt to RTTest.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/getopt.h

    r26476 r26485  
    205205    /** The index of an index option, otherwise UINT32_MAX. */
    206206    uint32_t        uIndex;
    207     /* More members will be added later for dealing with initial
    208        call, optional sorting, '--' and so on. */
     207    /** The flags passed to RTGetOptInit.  */
     208    uint32_t        fFlags;
     209    /** Number of non-options that we're skipping during a sorted get.  The value
     210     * INT32_MAX is used to indicate that there are no more options.  This is used
     211     * to implement '--'.   */
     212    int32_t         cNonOptions;
     213
     214    /* More members may be added later for dealing with new features. */
    209215} RTGETOPTSTATE;
    210216/** Pointer to RTGetOpt state. */
     
    235241                         PCRTGETOPTDEF paOptions, size_t cOptions,
    236242                         int iFirst, uint32_t fFlags);
     243
     244/** @name RTGetOptInit flags.
     245 * @{ */
     246/** Sort the arguments so that options comes first, then non-options. */
     247#define RTGETOPTINIT_FLAGS_OPTS_FIRST   RT_BIT_32(0)
     248/** Prevent add the standard version and help options:
     249 *     - "--help", "-h" and "-?" returns 'h'.
     250 *     - "--version" and "-V" return 'V'.
     251 */
     252#define RTGETOPTINIT_FLAGS_NO_STD_OPTS  RT_BIT_32(1)
     253/** @} */
    237254
    238255/**
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