Skip to content

class Athena::Console::Input::ARGV
inherits Athena::Console::Input #

An ACON::Input::Interface based on ARGV.

Direct known subclasses

Athena::Console::Completion::Input Athena::Console::Input::StringLine

Constructors#

.new(tokens : Array(String) = ::ARGV, definition : ACON::Input::Definition | Nil = nil)#

View source

.new(*tokens : String)#

View source

Methods#

#first_argument : String | ::Nil#

Returns the first argument from the raw un-parsed input. Mainly used to get the command that should be executed. ameba:disable Metrics/CyclomaticComplexity

View source

#has_parameter?(*values : String, only_params : Bool = false) : Bool#

Returns true if the raw un-parsed input contains one of the provided values.

This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. It does not necessarily return the correct result for short options when multiple flags are combined in the same option.

If only_params is true, only real parameters are checked. I.e. skipping those that come after the -- option.

View source

#parameter(value : String, default : _ = false, only_params : Bool = false)#

Returns the value of a raw un-parsed parameter for the provided value..

This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. It does not necessarily return the correct result for short options when multiple flags are combined in the same option.

If only_params is true, only real parameters are checked. I.e. skipping those that come after the -- option.

View source

#to_s(io : IO) : Nil#

Returns a string representation of the args passed to the command.

View source