Changeset 96729 in vbox for trunk/include/iprt
- Timestamp:
- Sep 14, 2022 9:14:53 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/getopt.h
r96407 r96729 130 130 /** The index value is attached to the argument - only valid for long arguments. */ 131 131 #define RTGETOPT_FLAG_INDEX RT_BIT(19) 132 /** Used with RTGETOPT_FLAG_INDEX, setting index to zero if none given. 133 * (The default is to fail with VERR_GETOPT_INDEX_MISSING.) */ 134 #define RTGETOPT_FLAG_INDEX_DEF_0 RT_BIT(20) 135 /** Used with RTGETOPT_FLAG_INDEX, setting index to one if none given. 136 * (The default is to fail with VERR_GETOPT_INDEX_MISSING.) */ 137 #define RTGETOPT_FLAG_INDEX_DEF_1 RT_BIT(21) 138 /** For simplicity. */ 139 #define RTGETOPT_FLAG_INDEX_DEF_MASK (RT_BIT(20) | RT_BIT(21)) 140 /** For simple conversion. */ 141 #define RTGETOPT_FLAG_INDEX_DEF_SHIFT 20 142 /** For use with RTGETOPT_FLAG_INDEX_DEF_0 or RTGETOPT_FLAG_INDEX_DEF_1 to 143 * imply a dash before the index when a digit is specified. 144 * This is for transitioning from options without index to optionally allow 145 * index options, i.e. "--long" defaults to either index 1 or 1 using the above 146 * flags, while "--long-1" explicitly gives the index ("--long-" is not valid). 147 * This flag matches an "-" separating the "--long" string 148 * (RTGETOPTDEFS::pszLong) from the index value. */ 149 #define RTGETOPT_FLAG_INDEX_DEF_DASH RT_BIT(22) 132 150 /** Treat the long option as case insensitive. */ 133 #define RTGETOPT_FLAG_ICASE RT_BIT(2 0)151 #define RTGETOPT_FLAG_ICASE RT_BIT(23) 134 152 /** Mask of valid bits - for validation. */ 135 153 #define RTGETOPT_VALID_MASK ( RTGETOPT_REQ_MASK \ … … 138 156 | RTGETOPT_FLAG_DEC \ 139 157 | RTGETOPT_FLAG_INDEX \ 140 | RTGETOPT_FLAG_ICASE) 158 | RTGETOPT_FLAG_INDEX_DEF_0 \ 159 | RTGETOPT_FLAG_INDEX_DEF_1 \ 160 | RTGETOPT_FLAG_INDEX_DEF_DASH \ 161 | RTGETOPT_FLAG_ICASE ) 141 162 /** @} */ 142 163 … … 165 186 * 166 187 * What ends up here depends on argument format in the option definition. 167 *168 * @remarks Integers will bet put in the \a i and \a u members and sign/zero extended169 * according to the signedness indicated by the \a fFlags. So, you can choose170 * use which ever of the integer members for accessing the value regardless171 * of restrictions indicated in the \a fFlags.172 188 */ 173 189 typedef union RTGETOPTUNION
Note:
See TracChangeset
for help on using the changeset viewer.