var default_value: VALUE is writable
# Create a new option
- init(help: String, default: VALUE, names: nullable Array[String])
- do
+ init(help: String, default: VALUE, names: nullable Array[String]) is old_style_init do
init_opt(help, default, names)
end
# Not really an option. Just add a line of text when displaying the usage
class OptionText
super Option
- init(text: String) do super(text, null, null)
+
+ init(text: String) is old_style_init do super(text, null, null)
redef fun pretty(off) do return to_s
super Option
redef type VALUE: Bool
- init(help: String, names: String...) do super(help, false, names)
+ init(help: String, names: String...) is old_style_init do super(help, false, names)
redef fun read_param(it)
do
super Option
redef type VALUE: Int
- init(help: String, names: String...) do super(help, 0, names)
+ init(help: String, names: String...) is old_style_init do super(help, 0, names)
redef fun read_param(it)
do
super OptionParameter
redef type VALUE: nullable String
- init(help: String, names: String...) do super(help, null, names)
+ init(help: String, names: String...) is old_style_init do super(help, null, names)
redef fun convert(str) do return str
end
redef type VALUE: Int
var values: Array[String]
- init(values: Array[String], help: String, default: Int, names: String...)
- do
+ init(values: Array[String], help: String, default: Int, names: String...) is old_style_init do
assert values.length > 0
self.values = values.to_a
super("{help} <{values.join(", ")}>", default, names)
super OptionParameter
redef type VALUE: Int
- init(help: String, default: Int, names: String...) do super(help, default, names)
+ init(help: String, default: Int, names: String...) is old_style_init do
+ super(help, default, names)
+ end
redef fun convert(str) do return str.to_i
end
super OptionParameter
redef type VALUE: Float
- init(help: String, default: Float, names: String...) do super(help, default, names)
+ init(help: String, default: Float, names: String...) is old_style_init do
+ super(help, default, names)
+ end
redef fun convert(str) do return str.to_f
end
super OptionParameter
redef type VALUE: Array[String]
- init(help: String, names: String...)
- do
+ init(help: String, names: String...) is old_style_init do
values = new Array[String]
super(help, values, names)
end