Skip to content

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

A specialization of ACON::Input::ARGV that allows for unfinished name/values. Exposes information about the name, type, and value of the value/name being completed.

Constructors#

.from_string(input : String, current_index : Int32) : self#

View source

.from_tokens(tokens : Array(String), current_index : Int32) : self#

View source

Methods#

#bind(definition : ACON::Input::Definition) : Nil#

:inherit:

ameba:disable Metrics/CyclomaticComplexity

View source

#completion_name : String | ::Nil#

Returns the name of the argument/option when completing a value.

View source

#completion_type : ACON::Completion::Input::Type#

Returns which type of completion is required.

View source

#completion_value : String#

Returns the value typed by the user, or empty string.

View source

#must_suggest_argument_values_for?(argument_name : String) : Bool#

Returns true if this input is able to suggest values for the provided argument_name.

View source

#must_suggest_values_for?(option_name : String) : Bool#

Returns true if this input is able to suggest values for the provided option_name.

View source

#relevant_token : String#

Returns the current token of the cursor, or last token if the cursor is at the end of the input.

View source