struct

Cling::Options

Inherits Struct < Value < Object

An input structure to access validated options at execution time.

Instance methods

[](key : String) : Option

Indexes an option by its long name and returns the Option object, not the option's value.

Source
[](key : Char) : Option

Indexes an option by its short name and returns the Option object, not the option's value.

Source
[]?(key : String) : Option | Nil

Indexes an option by its long name and returns the Option object or nil if not found, not the option's value.

Source
[]?(key : Char) : Option | Nil

Indexes an option by its short name and returns the Option object or nil if not found, not the option's value.

Source
empty?

Returns true if there are no parsed options.

Source
get(key : String | Char) : Value

Gets an option by its short or long name and returns its Value.

Source
get?(key : String | Char) : Value | Nil

Gets an option by its short or long name and returns its Value, or nil if not found.

Source
has?(key : String) : Bool

Returns true if an option by the given long name exists.

Source
has?(key : Char) : Bool

Returns true if an option by the given short name exists.

Source
hash

Generates an UInt64 hash value for this object.

This method must have the property that a == b implies a.hash == b.hash.

The hash value is used along with == by the Hash class to determine if two objects reference the same hash key.

Subclasses must not override this method. Instead, they must define hash(hasher), though usually the macro def_hash can be used to generate this method.

Source
size

Returns the number of parsed options.

Source