Skip to content

struct Tabular::Tablet
inherits Struct #

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

Constants#

NONE = Tablet.new(:none)#

Basically, Tablet? minus the baggage.

Constructors#

.new(kind : Kind, name : String = "", aliases = [] of String, help = "", directives : Directable | Nil = nil, delimiters = Tabular.delimiters)#

Create a new Tablet.

  • kind: See #kind.
  • name: See #name.
  • aliases: See #aliases.
  • help: See #help.
  • directives: See #directives.
  • delimiters: Ad hoc delimiters that will override [Tabular.delimiters][].
View source

Methods#

#aliases#

A list of additional names the Tablet will suggest/match.

View source

#candidate(arg : String, & : String -> )#

Yield suggestions for any names that contain arg.

View source

#directives#

Additional directives the Tablet will send to the shell if suggested.

View source

#form?#

Return true if a nested form exists.

View source

#help#

The description of the parameter the Tablet represents.

View source

#kind#

The representation of the Tablet.

View source

#match!(arg : String)#

Returns self if arg is an exact match of any names. Otherwise, raise Error::Match.

View source

#match?(arg : String) : Bool#

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

View source

#name#

The name of the parameter the Tablet represents.

View source

#next#

For an Option-flavoured Tablet with #form?, yield the next Argument-flavoured Tablet to the specified &block.

View source

#to_s(io : IO)#

Same as #inspect(io).

View source