struct

Tabular::Tablet

Inherits Struct < Value < Object

Represents a parameter whose name and aliases may be suggested and matched during tab completion.

Constants

NONE = Tablet.new(:none, directives: :no_file)

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].

  • 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].
Source

Instance methods

aliases

A list of additional names the [Tablet][Tabular::Tablet] will suggest/match.

Source
candidate(word : String, prefix : String = "", & : String -> )

Yield suggestions for any names that contain word.

Source
delimits?(word : String) : Bool

Return true if word is a delimited match of any names.

Source
directives

Additional directives the [Tablet][Tabular::Tablet] will send to the shell if suggested.

Source
form?

Return true if a nested form exists.

Source
help

The description of the parameter the [Tablet][Tabular::Tablet] represents.

Source
kind

The representation of the [Tablet][Tabular::Tablet].

Source
match!(word : String)

Returns self if word is an exact match of any names. Otherwise, raise [Error::Match][Tabular::Error::Match].

Source
match?(word : String) : Bool

Return true if word is an exact match of any names.

Source
name

The name of the parameter the [Tablet][Tabular::Tablet] represents.

Source
next

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.

Source
repeatable?

Return true, the [Tablet][Tabular::Tablet] may appear more than once.

Source
to_prefix(word : String) : Tuple(String, String)

Return the specified word and possible prefix, if delimited.

Source
to_s(io : IO)

Same as #inspect(io).

Source