struct CLI::ArgsInput

Overview

An input structure to access validated arguments at execution time.

Defined in:

cli/argument.cr

Instance Method Summary

Instance Method Detail

def [](key : String) : Argument #

Indexes an argument by its name and returns the Argument object, not the argument's value.


[View source]
def []?(key : String) : Argument | Nil #

Indexes an argument by its name and returns the Argument object or nil if not found, not the argument's value.


[View source]
def args : Hash(String, Argument) #

[View source]
def empty? : Bool #

Returns true if there are no parsed arguments.


[View source]
def get(key : String) : Value | Nil #

Gets an argument by its name and returns its Value, or nil if not found.


[View source]
def get!(key : String) : Value #

Gets an argument by its name and returns its Value.


[View source]
def has?(key : String) : Bool #

Returns true if an argument by the given name exists.


[View source]
def size : Int32 #

Returns the number of parsed arguments.


[View source]