MCPcopy Create free account
hub / github.com/PDAL/PDAL / assignPositional

Method assignPositional

pdal/util/ProgramArgs.hpp:460–476  ·  view source on GitHub ↗

Set the argument's value from the command-line args. If no value is provided for a required positional option, an arg_error exception is thrown. \note Not intended to be called from user code. \param vals The list of command-line args. */

Source from the content-addressed store, hash-verified

458 \param vals The list of command-line args.
459 */
460 virtual void assignPositional(ArgValList& vals)
461 {
462 if (m_positional == PosType::None || m_set)
463 return;
464 for (size_t i = vals.firstUnconsumed(); i < vals.size(); ++i)
465 {
466 const std::string& val = vals[i];
467 if ((val.size() && val[0] == '-') || vals.consumed(i))
468 continue;
469 setValue(val);
470 vals.consume(i);
471 return;
472 }
473 if (m_positional == PosType::Required)
474 throw arg_error("Missing value for positional argument '" +
475 m_longname + "'.");
476 }
477
478 /**
479 Return whether a default value was provided for the argument.

Callers

nothing calls this directly

Calls 5

setValueFunction · 0.85
firstUnconsumedMethod · 0.80
consumedMethod · 0.80
consumeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected