Optimist::Option
Inherits Reference < Object
Abstract base class for all other Options.
Constructors
Class methods
create(name : String, desc : String, cls : Class | Nil = nil, default : _ = nil, **kwargs)
Factory class method
Determines which type of object to create based on arguments passed
to Optimist.opt. This is tricky because we allow the default
to be able to set the option's type.
Instance methods
add_argument_value(a : Array(String), b : Bool)
Sourcedefault
Sourcedesc
Sourcedescription_with_default(str)
Format the educate-line description including the default-value(s)
description_with_permitted(str)
Format the educate-line description including the permitted-value(s)
disallow_multiple_args(paramlist : Array(String))
Sourceeducate
Sourcefull_description
Format the educate-line description including the default and permitted value(s)
given?
Sourcelong
Sourcemax_args
Sourcemin_args
Sourcename
Sourceneeds_an_argument
Sourcepermitted
Sourcepermitted_response
Sourcepermitted_type_valid?
Sourcepermitted_value?(val : DefaultType) : Bool
Incoming values from the command-line should be strings, so we should stringify any permitted types as the basis of comparison.
required?
Sourceshort
Sourcetakes_an_argument
Sourcetakes_multiple
Sourcetrigger_callback
Sourcetype_format
Provide type-format string. Default to empty, but should probably be overridden for most subclasses.
validate_permitted(arg : String, value : DefaultType) : Void
Sourcevalue
Source