struct
Tabular::Tablet
- Tabular::Tablet
- Struct
- Value
- Object
Overview
Represents a parameter whose name and aliases may be suggested and matched during tab completion.
Defined in:
tabular/tablet.crConstant Summary
-
NONE =
Tablet.new(:none) -
Basically, [
Tablet?][Tabular::Tablet] minus the baggage.
Constructors
-
.new(kind : Kind, name : String = "", aliases = [] of String, help = "", directives : Directable | Nil = nil, delimiters = Tabular.delimiters, repeatable : Bool = false)
Create a new [
Tablet][Tabular::Tablet].
Instance Method Summary
-
#aliases : Set(String)
A list of additional names the [
Tablet][Tabular::Tablet] will suggest/match. -
#candidate(word : String, & : String -> )
Yield suggestions for any names that contain word.
-
#directives : Tabular::Directive
Additional directives the [
Tablet][Tabular::Tablet] will send to the shell if suggested. -
#form?
Return
trueif a nested form exists. -
#help : String
The description of the parameter the [
Tablet][Tabular::Tablet] represents. -
#kind : Tabular::Kind
The representation of the [
Tablet][Tabular::Tablet]. -
#match!(word : String)
Returns
selfif word is an exact match of any names. -
#match?(word : String) : Bool
Return
trueif word is an exact match of any names. -
#name : String
The name of the parameter the [
Tablet][Tabular::Tablet] represents. - #next(&)
-
#repeatable? : Bool
Return
true, the [Tablet][Tabular::Tablet] may appear more than once. -
#to_s(io : IO)
Same as
#inspect(io).
Constructor Detail
Create a new [Tablet][Tabular::Tablet].
- kind: See [
#kind][Tabular::Tablet#kind]. - name: See [
#name][Tabular::Tablet#name]. - aliases: See [
#aliases][Tabular::Tablet#aliases]. - help: See [
#help][Tabular::Tablet#help]. - directives: See [
#directives][Tabular::Tablet#directives]. - delimiters: Ad hoc delimiters that will override [
Habit#delimiters][Tabular::Habit#delimiters].
Instance Method Detail
A list of additional names the [Tablet][Tabular::Tablet] will suggest/match.
Additional directives the [Tablet][Tabular::Tablet] will send to the shell if suggested.
Returns self if word is an exact match of any names. Otherwise, raise [Error::Match][Tabular::Error::Match].
For an [Option][Tabular::Kind::Option]-flavoured [Tablet][Tabular::Tablet] with #form?, yield the next
[Argument][Tabular::Kind::Argument]-flavoured [Tablet][Tabular::Tablet] to the specified &block.