opts :: Option :: read_param
# Consume parameters for this option
protected fun read_param(opts: OptionContext, it: Iterator[String])
do
read = true
end
lib/opts/opts.nit:93,2--97,4
redef fun read_param(opts, it)
do
super
value = true
end
lib/opts/opts.nit:120,2--124,4
redef fun read_param(opts, it)
do
super
value += 1
end
lib/opts/opts.nit:135,2--139,4
redef fun read_param(opts, it)
do
super
var ok = it.is_ok
if ok and not parameter_mandatory and not it.item.is_empty and it.item.chars.first == '-' then
# The next item may looks like a known command
# Only check if `not parameter_mandatory`
for opt in opts.options do
if opt.names.has(it.item) then
# The next item is a known command
ok = false
break
end
end
end
if ok then
value = convert(it.item)
it.next
else
errors.add("Parameter expected for option {names.first}.")
end
end
lib/opts/opts.nit:152,2--175,4