opts :: OptionArray
myprog -optA arg1 -optA arg2
is giving an Array ["arg1", "arg2"]
opts :: OptionArray :: defaultinit
Init a new OptionArray with ahelp
message and names
.
opts $ OptionArray :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
opts :: Option :: default_value=
Default value of this optionopts :: OptionParameter :: defaultinit
opts :: OptionArray :: defaultinit
Init a new OptionArray with ahelp
message and names
.
core :: Object :: defaultinit
opts :: Option :: defaultinit
Create a new optioncore :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).opts :: OptionParameter :: parameter_mandatory
Is the parameter mandatory?opts :: OptionParameter :: parameter_mandatory=
Is the parameter mandatory?opts :: Option :: read_param
Consume parameters for this option
# An option with an array as parameter
# `myprog -optA arg1 -optA arg2` is giving an Array `["arg1", "arg2"]`
class OptionArray
super OptionParameter
redef type VALUE: Array[String]
# Init a new OptionArray with a `help` message and `names`.
init(help: String, names: String...) is old_style_init do
values = new Array[String]
super(help, values, names)
end
private var values: Array[String]
redef fun convert(str)
do
values.add(str)
return values
end
end
lib/opts/opts.nit:261,1--279,3