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