struct CLI::OptionsInput
- CLI::OptionsInput
- Struct
- Value
- Object
Overview
An input structure to access validated options at execution time.
Defined in:
cli/option.crInstance Method Summary
-
#[](key : String) : Option
Indexes an option by its long name and returns the
Option
object, not the option's value. -
#[](key : Char) : Option
Indexes an option by its short name and returns the
Option
object, not the option's value. -
#[]?(key : String) : Option | Nil
Indexes an option by its long name and returns the
Option
object ornil
if not found, not the option's value. -
#[]?(key : Char) : Option | Nil
Indexes an option by its short name and returns the
Option
object ornil
if not found, not the option's value. -
#empty? : Bool
Returns
true
if there are no parsed options. -
#get(key : String | Char) : Value | Nil
Gets an option by its short or long name and returns its
Value
, ornil
if not found. -
#get!(key : String | Char) : Value
Gets an option by its short or long name and returns its
Value
. -
#has?(key : String) : Bool
Returns
true
if an option by the given long name exists. -
#has?(key : Char) : Bool
Returns
true
if an option by the given short name exists. - #options : Hash(String, Option)
-
#size : Int32
Returns the number of parsed options.
Instance Method Detail
Indexes an option by its long name and returns the Option
object, not the option's
value.
Indexes an option by its short name and returns the Option
object, not the option's
value.
Indexes an option by its long name and returns the Option
object or nil
if not found,
not the option's value.
Indexes an option by its short name and returns the Option
object or nil
if not found,
not the option's value.
Gets an option by its short or long name and returns its Value
, or nil
if not found.
Gets an option by its short or long name and returns its Value
.