Lines Matching defs:opt

128 		const OptInfo& opt = *optIter;
130 DE_ASSERT(opt.shortName || opt.longName);
132 if (opt.shortName)
134 DE_ASSERT(shortOptMap.find(opt.shortName) == shortOptMap.end());
135 shortOptMap[opt.shortName] = &opt;
138 if (opt.longName)
140 DE_ASSERT(longOptMap.find(opt.longName) == longOptMap.end());
141 longOptMap[opt.longName] = &opt;
145 if (opt.defaultValue)
146 opt.dispatchParse(&opt, opt.defaultValue, &dst->m_options);
147 else if (opt.setDefault)
148 opt.setDefault(&dst->m_options);
173 const OptInfo* opt = optPos != optMap.end() ? optPos->second : DE_NULL;
175 if (!opt)
182 if (seenOpts.find(opt) != seenOpts.end())
184 err << "Command line option '--" << opt->longName << "' specified multiple times\n";
189 seenOpts.insert(opt);
191 if (opt->isFlag)
195 opt->dispatchParse(opt, DE_NULL, &dst->m_options);
199 err << "No value expected for command line option '--" << opt->longName << "'\n";
216 opt->dispatchParse(opt, value, &dst->m_options);
220 err << "Got error parsing command line option '--" << opt->longName << "': " << e.what() << "\n";
226 err << "Expected value for command line option '--" << opt->longName << "'\n";
249 const OptInfo& opt = *optIter;
252 if (opt.shortName)
253 str << "-" << opt.shortName;
255 if (opt.shortName && opt.longName)
258 if (opt.longName)
259 str << "--" << opt.longName;
261 if (opt.namedValues)
265 for (const void* curValue = opt.namedValues; curValue != opt.namedValuesEnd; curValue = (const void*)((deUintptr)curValue + opt.namedValueStride))
267 if (curValue != opt.namedValues)
274 else if (!opt.isFlag)
279 if (opt.description)
280 str << " " << opt.description << "\n";
282 if (opt.defaultValue)
283 str << " default: '" << opt.defaultValue << "'\n";
415 << Option<TestNamedOpt> ("n", "named", "Test named opt", DE_ARRAY_BEGIN(s_namedValues), DE_ARRAY_END(s_namedValues), "one");